07 Apr 2012
This commit is contained in:
parent
a4a0fe5a8d
commit
cb2bb0aa89
|
@ -10,6 +10,7 @@ Engine: fix potentially crash in menu after calling Host_Error
|
|||
Engine: fix crash on Cry Of Fear modification (memory corrupts)
|
||||
Engine: first implementation of HLTV
|
||||
Render: fix a little bug with engine mirrors
|
||||
Sound: implement separate volume controls for background track and game sounds
|
||||
|
||||
build 1850
|
||||
|
||||
|
|
|
@ -447,7 +447,7 @@ void CL_PlaybackEvent( int flags, const edict_t *pInvoker, word eventindex, floa
|
|||
args.flags = 0;
|
||||
args.entindex = invokerIndex;
|
||||
|
||||
// FIXME: restore checks when predicting will be done
|
||||
// TODO: restore checks when predicting will be done
|
||||
// if( !angles || VectorIsNull( angles ))
|
||||
VectorCopy( cl.refdef.cl_viewangles, args.angles );
|
||||
|
||||
|
|
|
@ -483,7 +483,8 @@ void CL_ParseServerData( sizebuf_t *msg )
|
|||
clgame.load_sequence++; // now all hud sprites are invalid
|
||||
|
||||
// wipe the client_t struct
|
||||
if( !cls.changelevel ) CL_ClearState();
|
||||
if( !cls.changelevel )
|
||||
CL_ClearState ();
|
||||
cls.state = ca_connected;
|
||||
|
||||
// parse protocol version number
|
||||
|
|
|
@ -356,7 +356,7 @@ channel_t *SND_PickStaticChannel( int entnum, sfx_t *sfx, const vec3_t pos )
|
|||
channel_t *ch = NULL;
|
||||
int i, dupe = 0;
|
||||
|
||||
#if 1 // FIXME: remove this code when predicting is will be done
|
||||
#if 1 // TODO: remove this code when predicting is will be done
|
||||
// check for dupliacte sounds
|
||||
for( i = 0; i < total_channels; i++ )
|
||||
{
|
||||
|
|
|
@ -60,8 +60,8 @@ S_TransferPaintBuffer
|
|||
*/
|
||||
void S_TransferPaintBuffer( int endtime )
|
||||
{
|
||||
int lpos, lpaintedtime, snd_vol;
|
||||
int *snd_p, snd_linear_count;
|
||||
int lpos, lpaintedtime;
|
||||
int i, val, sampleMask;
|
||||
short *snd_out;
|
||||
dword *pbuf;
|
||||
|
@ -71,8 +71,6 @@ void S_TransferPaintBuffer( int endtime )
|
|||
lpaintedtime = paintedtime;
|
||||
sampleMask = ((dma.samples >> 1) - 1);
|
||||
|
||||
snd_vol = S_GetMasterVolume() * 256;
|
||||
|
||||
while( lpaintedtime < endtime )
|
||||
{
|
||||
// handle recirculating buffer issues
|
||||
|
@ -89,14 +87,14 @@ void S_TransferPaintBuffer( int endtime )
|
|||
// write a linear blast of samples
|
||||
for( i = 0; i < snd_linear_count; i += 2 )
|
||||
{
|
||||
val = (snd_p[i+0] * snd_vol) >> 8;
|
||||
val = (snd_p[i+0] * 256) >> 8;
|
||||
|
||||
if( val > 0x7fff ) snd_out[i+0] = 0x7fff;
|
||||
else if( val < (short)0x8000 )
|
||||
snd_out[i+0] = (short)0x8000;
|
||||
else snd_out[i+0] = val;
|
||||
|
||||
val = (snd_p[i+1] * snd_vol) >> 8;
|
||||
val = (snd_p[i+1] * 256) >> 8;
|
||||
if( val > 0x7fff ) snd_out[i+1] = 0x7fff;
|
||||
else if( val < (short)0x8000 )
|
||||
snd_out[i+1] = (short)0x8000;
|
||||
|
@ -1042,7 +1040,10 @@ void MIX_PaintChannels( int endtime )
|
|||
DSP_Process( idsp_room, MIX_GetPFrontFromIPaint( IROOMBUFFER ), count );
|
||||
|
||||
// add music or soundtrack from movie (no dsp)
|
||||
MIX_MixPaintbuffers( IROOMBUFFER, ISTREAMBUFFER, IPAINTBUFFER, count, s_musicvolume->value );
|
||||
MIX_MixPaintbuffers( IPAINTBUFFER, IROOMBUFFER, IPAINTBUFFER, count, S_GetMasterVolume() );
|
||||
|
||||
// add music or soundtrack from movie (no dsp)
|
||||
MIX_MixPaintbuffers( IPAINTBUFFER, ISTREAMBUFFER, IPAINTBUFFER, count, s_musicvolume->value );
|
||||
|
||||
// clip all values > 16 bit down to 16 bit
|
||||
MIX_CompressPaintbuffer( IPAINTBUFFER, count );
|
||||
|
|
|
@ -79,7 +79,7 @@ typedef enum
|
|||
#include "com_model.h"
|
||||
#include "crtlib.h"
|
||||
|
||||
#define XASH_VERSION 0.91f // engine current version
|
||||
#define XASH_VERSION 0.95f // engine current version
|
||||
|
||||
// PERFORMANCE INFO
|
||||
#define MIN_FPS 15.0 // host minimum fps value for maxfps.
|
||||
|
|
|
@ -952,7 +952,7 @@ static qboolean FS_WriteGameInfo( const char *filepath, gameinfo_t *GameInfo )
|
|||
f = FS_Open( filepath, "w", false ); // we in binary-mode
|
||||
if( !f ) return false;
|
||||
|
||||
FS_Print( f, "// generated by Xash3D\r\r\n" );
|
||||
FS_Print( f, "// generated by Xash3D\n\n\n" );
|
||||
|
||||
if( Q_strlen( GameInfo->basedir ))
|
||||
FS_Printf( f, "basedir\t\t\"%s\"\n", GameInfo->basedir );
|
||||
|
@ -1033,7 +1033,7 @@ static qboolean FS_WriteGameInfo( const char *filepath, gameinfo_t *GameInfo )
|
|||
if( GameInfo->max_particles > 0 )
|
||||
FS_Printf( f, "max_particles\t%i\n", GameInfo->max_particles );
|
||||
|
||||
FS_Print( f, "\r\r\n" );
|
||||
FS_Print( f, "\n\n\n" );
|
||||
FS_Close( f ); // all done
|
||||
|
||||
return true;
|
||||
|
|
|
@ -782,6 +782,8 @@ int EXPORT Host_Main( const char *progname, int bChangeGame, pfnChangeGame func
|
|||
|
||||
if( host.type == HOST_DEDICATED )
|
||||
{
|
||||
Con_InitConsoleCommands ();
|
||||
|
||||
Cmd_AddCommand( "quit", Sys_Quit, "quit the game" );
|
||||
Cmd_AddCommand( "exit", Sys_Quit, "quit the game" );
|
||||
|
||||
|
|
|
@ -89,6 +89,14 @@ void Con_SetInputText( const char *inputText )
|
|||
SendMessage( s_wcd.hwndInputLine, EM_SETSEL, Q_strlen( inputText ), -1 );
|
||||
}
|
||||
|
||||
static void Con_Clear_f( void )
|
||||
{
|
||||
if( host.type != HOST_DEDICATED ) return;
|
||||
SendMessage( s_wcd.hwndBuffer, EM_SETSEL, 0, -1 );
|
||||
SendMessage( s_wcd.hwndBuffer, EM_REPLACESEL, FALSE, (LPARAM)"" );
|
||||
UpdateWindow( s_wcd.hwndBuffer );
|
||||
}
|
||||
|
||||
static int Con_KeyEvent( int key, qboolean down )
|
||||
{
|
||||
char inputBuffer[1024];
|
||||
|
@ -380,6 +388,19 @@ void Con_CreateConsole( void )
|
|||
else s_wcd.status = false;
|
||||
}
|
||||
|
||||
/*
|
||||
================
|
||||
Con_InitConsoleCommands
|
||||
|
||||
register console commands (dedicated only)
|
||||
================
|
||||
*/
|
||||
void Con_InitConsoleCommands( void )
|
||||
{
|
||||
if( host.type != HOST_DEDICATED ) return;
|
||||
Cmd_AddCommand( "clear", Con_Clear_f, "clear console history" );
|
||||
}
|
||||
|
||||
/*
|
||||
================
|
||||
Con_DestroyConsole
|
||||
|
|
|
@ -99,6 +99,7 @@ void Sys_Quit( void );
|
|||
//
|
||||
void Con_ShowConsole( qboolean show );
|
||||
void Con_WinPrint( const char *pMsg );
|
||||
void Con_InitConsoleCommands( void );
|
||||
void Con_CreateConsole( void );
|
||||
void Con_DestroyConsole( void );
|
||||
void Con_RegisterHotkeys( void );
|
||||
|
|
|
@ -304,7 +304,6 @@ typedef struct
|
|||
void *vp; // acess by offset in bytes
|
||||
};
|
||||
int numEntities; // actual entities count
|
||||
float force_retouch; // always start at new frame to relink all ents
|
||||
|
||||
movevars_t movevars; // curstate
|
||||
movevars_t oldmovevars; // oldstate
|
||||
|
|
|
@ -4750,7 +4750,6 @@ qboolean SV_LoadProgs( const char *name )
|
|||
SV_InitSaveRestore ();
|
||||
|
||||
svgame.globals->pStringBase = ""; // setup string base
|
||||
svgame.force_retouch = 0.0f;
|
||||
|
||||
svgame.globals->maxEntities = GI->max_edicts;
|
||||
svgame.globals->maxClients = sv_maxclients->integer;
|
||||
|
|
|
@ -1529,7 +1529,7 @@ void SV_Physics_Step( edict_t *ent )
|
|||
}
|
||||
else
|
||||
{
|
||||
if( svgame.force_retouch != 0.0f )
|
||||
if( svgame.globals->force_retouch != 0.0f )
|
||||
{
|
||||
trace = SV_Move(ent->v.origin, ent->v.mins, ent->v.maxs, ent->v.origin, MOVE_NORMAL, ent );
|
||||
if(( trace.fraction < 1.0f || trace.startsolid ) && SV_IsValidEdict( trace.ent ))
|
||||
|
@ -1576,7 +1576,7 @@ static void SV_Physics_Entity( edict_t *ent )
|
|||
}
|
||||
ent->v.flags &= ~FL_BASEVELOCITY;
|
||||
|
||||
if( svgame.force_retouch != 0.0f )
|
||||
if( svgame.globals->force_retouch != 0.0f )
|
||||
{
|
||||
// force retouch even for stationary
|
||||
SV_LinkEdict( ent, true );
|
||||
|
@ -1635,9 +1635,6 @@ void SV_Physics( void )
|
|||
SV_CheckAllEnts ();
|
||||
|
||||
svgame.globals->time = sv.time;
|
||||
svgame.force_retouch = svgame.globals->force_retouch;
|
||||
if( svgame.force_retouch != 0.0f )
|
||||
svgame.globals->force_retouch = max( 0.0f, svgame.globals->force_retouch - 1.0f );
|
||||
|
||||
// let the progs know that a new frame has started
|
||||
svgame.dllFuncs.pfnStartFrame();
|
||||
|
@ -1666,6 +1663,9 @@ void SV_Physics( void )
|
|||
|
||||
// decrement svgame.numEntities if the highest number entities died
|
||||
for( ; EDICT_NUM( svgame.numEntities - 1 )->free; svgame.numEntities-- );
|
||||
|
||||
if( svgame.globals->force_retouch != 0.0f )
|
||||
svgame.globals->force_retouch--;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Reference in New Issue