03 Apr 2010

This commit is contained in:
g-cont 2010-04-03 00:00:00 +04:00 committed by Alibek Omarov
parent 8fa895f8ab
commit 0915c8647b
38 changed files with 343 additions and 544 deletions

View File

@ -1,16 +0,0 @@
<html>
<body>
<pre>
<h1>Build Log</h1>
<h3>
--------------------Configuration: baserc - Win32 Debug--------------------
</h3>
<h3>Command Lines</h3>
<h3>Results</h3>
baserc.dll - 0 error(s), 0 warning(s)
</pre>
</body>
</html>

View File

@ -1,16 +0,0 @@
<html>
<body>
<pre>
<h1>Build Log</h1>
<h3>
--------------------Configuration: client - Win32 Debug--------------------
</h3>
<h3>Command Lines</h3>
<h3>Results</h3>
client.dll - 0 error(s), 0 warning(s)
</pre>
</body>
</html>

View File

@ -1,16 +0,0 @@
<html>
<body>
<pre>
<h1>Build Log</h1>
<h3>
--------------------Configuration: cms_qf - Win32 Debug--------------------
</h3>
<h3>Command Lines</h3>
<h3>Results</h3>
cms_qf.dll - 0 error(s), 0 warning(s)
</pre>
</body>
</html>

View File

@ -1,16 +0,0 @@
<html>
<body>
<pre>
<h1>Build Log</h1>
<h3>
--------------------Configuration: cms_xr - Win32 Debug--------------------
</h3>
<h3>Command Lines</h3>
<h3>Results</h3>
cms_xr.dll - 0 error(s), 0 warning(s)
</pre>
</body>
</html>

View File

@ -229,7 +229,7 @@ void CL_ParseFrame( sizebuf_t *msg )
}
else
{
cl.oldframe = &cl.frames[cl.frame.deltaframe & UPDATE_MASK];
cl.oldframe = &cl.frames[cl.frame.deltaframe & CL_UPDATE_MASK];
if( !cl.oldframe->valid )
{
// should never happen
@ -258,7 +258,7 @@ void CL_ParseFrame( sizebuf_t *msg )
CL_ParsePacketEntities( msg, cl.oldframe, &cl.frame );
// save the frame off in the backup array for later delta comparisons
cl.frames[cl.frame.serverframe & UPDATE_MASK] = cl.frame;
cl.frames[cl.frame.serverframe & CL_UPDATE_MASK] = cl.frame;
if( !cl.frame.valid ) return;

View File

@ -804,6 +804,9 @@ void CL_InitEdicts( void )
Com_Assert( clgame.edicts != NULL );
Com_Assert( clgame.baselines != NULL );
CL_UPDATE_BACKUP = ( clgame.globals->maxClients == 1 ) ? SINGLEPLAYER_BACKUP : MULTIPLAYER_BACKUP;
cl.frames = Mem_Alloc( clgame.mempool, sizeof( frame_t ) * CL_UPDATE_BACKUP );
clgame.edicts = Mem_Alloc( clgame.mempool, sizeof( edict_t ) * clgame.globals->maxEntities );
clgame.baselines = Mem_Alloc( clgame.mempool, sizeof( entity_state_t ) * clgame.globals->maxEntities );
for( i = 0, e = clgame.edicts; i < clgame.globals->maxEntities; i++, e++ )
@ -826,6 +829,7 @@ void CL_FreeEdicts( void )
Mem_Free( clgame.edicts );
}
if( cl.frames ) Mem_Free( cl.frames );
if( clgame.baselines ) Mem_Free( clgame.baselines );
// clear globals
@ -837,6 +841,7 @@ void CL_FreeEdicts( void )
clgame.globals->numEntities = 0;
clgame.baselines = NULL;
clgame.edicts = NULL;
cl.frames = NULL;
}
bool CL_IsValidEdict( const edict_t *e )

View File

@ -345,7 +345,7 @@ void CL_ClearState( void )
{
S_StopAllSounds ();
CL_ClearEffects ();
CL_FreeEdicts();
CL_FreeEdicts ();
if( clgame.hInstance ) clgame.dllFuncs.pfnReset();

View File

@ -10,6 +10,8 @@
#define MSG_COUNT 32 // last 32 messages parsed
#define MSG_MASK (MSG_COUNT - 1)
int CL_UPDATE_BACKUP = SINGLEPLAYER_BACKUP;
char *svc_strings[256] =
{
"svc_bad",

View File

@ -51,7 +51,10 @@ typedef struct frame_s
#define CMD_BACKUP 64 // allow a lot of command backups for very fast systems
#define CMD_MASK (CMD_BACKUP - 1)
// the cl_parse_entities must be large enough to hold UPDATE_BACKUP frames of
#define CL_UPDATE_MASK (CL_UPDATE_BACKUP - 1)
extern int CL_UPDATE_BACKUP;
// the cl_parse_entities must be large enough to hold CL_UPDATE_BACKUP frames of
// entities, so that when a delta compressed message arives from the server
// it can be un-deltad from the original
#define MAX_PARSE_ENTITIES 2048
@ -72,7 +75,7 @@ typedef struct
frame_t frame; // received from server
frame_t *oldframe; // previous frame to lerping from
int surpressCount; // number of messages rate supressed
frame_t frames[UPDATE_BACKUP];
frame_t *frames; // alloced on svc_serverdata
int time; // this is the time value that the client
// is rendering at. always <= cls.realtime

View File

@ -289,8 +289,8 @@ extern byte net_message_buffer[MAX_MSGLEN];
#define PORT_MASTER 27900
#define PORT_CLIENT 27901
#define PORT_SERVER 27910
#define UPDATE_BACKUP 64 // copies of entity_state_t to keep buffered, must be power of two
#define UPDATE_MASK (UPDATE_BACKUP - 1)
#define MULTIPLAYER_BACKUP 64 // how many data slots to use when in multiplayer (must be power of 2)
#define SINGLEPLAYER_BACKUP 8 // same for single player
#define MAX_FLAGS 32 // 32 bits == 32 flags
#define MASK_FLAGS (MAX_FLAGS - 1)

View File

@ -1,100 +0,0 @@
<html>
<body>
<pre>
<h1>Build Log</h1>
<h3>
--------------------Configuration: engine - Win32 Debug--------------------
</h3>
<h3>Command Lines</h3>
Creating temporary file "C:\DOCUME~1\ĚČŘŔ\LOCALS~1\Temp\RSPBD0.tmp" with contents
[
/nologo /MDd /W3 /Gm /Gi /GX /ZI /Od /I "./" /I "common" /I "server" /I "client" /I "uimenu" /I "../public" /I "../common" /I "../game_shared" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FR"..\temp\engine\!debug/" /Fo"..\temp\engine\!debug/" /Fd"..\temp\engine\!debug/" /FD /c
"D:\Xash3D\src_main\engine\common\com_world.c"
]
Creating command line "cl.exe @"C:\DOCUME~1\ĚČŘŔ\LOCALS~1\Temp\RSPBD0.tmp""
Creating temporary file "C:\DOCUME~1\ĚČŘŔ\LOCALS~1\Temp\RSPBD1.tmp" with contents
[
user32.lib msvcrtd.lib /nologo /subsystem:windows /dll /incremental:yes /pdb:"..\temp\engine\!debug/engine.pdb" /debug /machine:I386 /nodefaultlib:"msvcrt.lib" /out:"..\temp\engine\!debug/engine.dll" /implib:"..\temp\engine\!debug/engine.lib" /pdbtype:sept
"\Xash3D\src_main\temp\engine\!debug\build.obj"
"\Xash3D\src_main\temp\engine\!debug\cinematic.obj"
"\Xash3D\src_main\temp\engine\!debug\cl_cmds.obj"
"\Xash3D\src_main\temp\engine\!debug\cl_demo.obj"
"\Xash3D\src_main\temp\engine\!debug\cl_effects.obj"
"\Xash3D\src_main\temp\engine\!debug\cl_frame.obj"
"\Xash3D\src_main\temp\engine\!debug\cl_game.obj"
"\Xash3D\src_main\temp\engine\!debug\cl_main.obj"
"\Xash3D\src_main\temp\engine\!debug\cl_move.obj"
"\Xash3D\src_main\temp\engine\!debug\cl_parse.obj"
"\Xash3D\src_main\temp\engine\!debug\cl_phys.obj"
"\Xash3D\src_main\temp\engine\!debug\cl_scrn.obj"
"\Xash3D\src_main\temp\engine\!debug\cl_tent.obj"
"\Xash3D\src_main\temp\engine\!debug\cl_video.obj"
"\Xash3D\src_main\temp\engine\!debug\cl_view.obj"
"\Xash3D\src_main\temp\engine\!debug\cl_world.obj"
"\Xash3D\src_main\temp\engine\!debug\com_keys.obj"
"\Xash3D\src_main\temp\engine\!debug\com_world.obj"
"\Xash3D\src_main\temp\engine\!debug\con_main.obj"
"\Xash3D\src_main\temp\engine\!debug\con_utils.obj"
"\Xash3D\src_main\temp\engine\!debug\engfuncs.obj"
"\Xash3D\src_main\temp\engine\!debug\host.obj"
"\Xash3D\src_main\temp\engine\!debug\infostring.obj"
"\Xash3D\src_main\temp\engine\!debug\input.obj"
"\Xash3D\src_main\temp\engine\!debug\net_chan.obj"
"\Xash3D\src_main\temp\engine\!debug\net_huff.obj"
"\Xash3D\src_main\temp\engine\!debug\net_msg.obj"
"\Xash3D\src_main\temp\engine\!debug\sv_client.obj"
"\Xash3D\src_main\temp\engine\!debug\sv_cmds.obj"
"\Xash3D\src_main\temp\engine\!debug\sv_frame.obj"
"\Xash3D\src_main\temp\engine\!debug\sv_game.obj"
"\Xash3D\src_main\temp\engine\!debug\sv_init.obj"
"\Xash3D\src_main\temp\engine\!debug\sv_main.obj"
"\Xash3D\src_main\temp\engine\!debug\sv_move.obj"
"\Xash3D\src_main\temp\engine\!debug\sv_phys.obj"
"\Xash3D\src_main\temp\engine\!debug\sv_save.obj"
"\Xash3D\src_main\temp\engine\!debug\sv_world.obj"
"\Xash3D\src_main\temp\engine\!debug\titles.obj"
"\Xash3D\src_main\temp\engine\!debug\ui_advcontrols.obj"
"\Xash3D\src_main\temp\engine\!debug\ui_audio.obj"
"\Xash3D\src_main\temp\engine\!debug\ui_configuration.obj"
"\Xash3D\src_main\temp\engine\!debug\ui_controls.obj"
"\Xash3D\src_main\temp\engine\!debug\ui_creategame.obj"
"\Xash3D\src_main\temp\engine\!debug\ui_credits.obj"
"\Xash3D\src_main\temp\engine\!debug\ui_customgame.obj"
"\Xash3D\src_main\temp\engine\!debug\ui_gameoptions.obj"
"\Xash3D\src_main\temp\engine\!debug\ui_langame.obj"
"\Xash3D\src_main\temp\engine\!debug\ui_loadgame.obj"
"\Xash3D\src_main\temp\engine\!debug\ui_main.obj"
"\Xash3D\src_main\temp\engine\!debug\ui_menu.obj"
"\Xash3D\src_main\temp\engine\!debug\ui_multiplayer.obj"
"\Xash3D\src_main\temp\engine\!debug\ui_newgame.obj"
"\Xash3D\src_main\temp\engine\!debug\ui_playdemo.obj"
"\Xash3D\src_main\temp\engine\!debug\ui_playersetup.obj"
"\Xash3D\src_main\temp\engine\!debug\ui_playrec.obj"
"\Xash3D\src_main\temp\engine\!debug\ui_qmenu.obj"
"\Xash3D\src_main\temp\engine\!debug\ui_recdemo.obj"
"\Xash3D\src_main\temp\engine\!debug\ui_savegame.obj"
"\Xash3D\src_main\temp\engine\!debug\ui_saveload.obj"
"\Xash3D\src_main\temp\engine\!debug\ui_video.obj"
"\Xash3D\src_main\temp\engine\!debug\ui_vidmodes.obj"
"\Xash3D\src_main\temp\engine\!debug\ui_vidoptions.obj"
]
Creating command line "link.exe @"C:\DOCUME~1\ĚČŘŔ\LOCALS~1\Temp\RSPBD1.tmp""
Creating temporary file "C:\DOCUME~1\ĚČŘŔ\LOCALS~1\Temp\RSPBD2.bat" with contents
[
@echo off
copy \Xash3D\src_main\temp\engine\!debug\engine.dll "D:\Xash3D\bin\engine.dll"
]
Creating command line ""C:\DOCUME~1\ĚČŘŔ\LOCALS~1\Temp\RSPBD2.bat""
Compiling...
com_world.c
d:\xash3d\src_main\engine\common\com_world.c(149) : error C2065: 'BASECONT_TRIGGER' : undeclared identifier
Error executing cl.exe.
<h3>Output Window</h3>
<h3>Results</h3>
engine.dll - 1 error(s), 0 warning(s)
</pre>
</body>
</html>

View File

@ -16,9 +16,17 @@
#define MAX_ENT_CLUSTERS 16
#define RATE_MESSAGES 10
#define SV_UPDATE_MASK (SV_UPDATE_BACKUP - 1)
extern int SV_UPDATE_BACKUP;
// hostflags
#define SVF_SKIPLOCALHOST BIT( 0 )
// mapvalid flags
#define MAP_IS_EXIST BIT( 0 )
#define MAP_HAS_SPAWNPOINT BIT( 1 )
#define MAP_HAS_LANDMARK BIT( 2 )
#define NUM_FOR_EDICT(e) ((int)((edict_t *)(e) - svgame.edicts))
#define EDICT_NUM( num ) SV_EDICT_NUM( num, __FILE__, __LINE__ )
#define STRING( offset ) SV_GetString( offset )
@ -125,7 +133,7 @@ typedef struct sv_client_s
sizebuf_t datagram;
byte datagram_buf[MAX_MSGLEN];
client_frame_t frames[UPDATE_BACKUP]; // updates can be delta'd from here
client_frame_t *frames; // updates can be delta'd from here
event_state_t events;
byte *download; // file being downloaded
@ -235,6 +243,7 @@ typedef struct
int groupmask;
int groupop;
float changelevel_next_time; // don't execute multiple changelevels at once time
int spawncount; // incremented each server start
// used to check late spawns
sv_client_t *clients; // [sv_maxclients->integer]
@ -405,7 +414,7 @@ string_t SV_AllocString( const char *szValue );
sv_client_t *SV_ClientFromEdict( const edict_t *pEdict, bool spawned_only );
const char *SV_GetString( string_t iString );
void SV_SetClientMaxspeed( sv_client_t *cl, float fNewMaxspeed );
bool SV_MapIsValid( const char *filename, const char *spawn_entity );
int SV_MapIsValid( const char *filename, const char *spawn_entity, const char *landmark_name );
void SV_StartSound( edict_t *ent, int chan, const char *sample, float vol, float attn, int flags, int pitch );
void SV_UpdateBaseVelocity( edict_t *ent );
bool SV_IsValidEdict( const edict_t *e );

View File

@ -70,6 +70,7 @@ void SV_DirectConnect( netadr_t from )
char userinfo[MAX_INFO_STRING];
sv_client_t temp, *cl, *newcl;
edict_t *ent;
client_frame_t *frames;
int i, edictnum;
int version;
int qport, count = 0;
@ -127,7 +128,10 @@ void SV_DirectConnect( netadr_t from )
else Info_SetValueForKey( userinfo, "ip", "127.0.0.1" ); // force the "ip" info key to "localhost"
newcl = &temp;
frames = newcl->frames; // keep frames pointer
Mem_Set( newcl, 0, sizeof( sv_client_t ));
newcl->frames = frames; // restore it
// if there is already a slot for this ip, reuse it
for( i = 0, cl = svs.clients; i < sv_maxclients->integer; i++, cl++ )
@ -170,7 +174,8 @@ gotnewcl:
ent->pvServerData->client = newcl;
newcl->edict = ent;
newcl->challenge = challenge; // save challenge for checksumming
newcl->frames = (client_frame_t *)Z_Malloc( sizeof( client_frame_t ) * SV_UPDATE_BACKUP );
// get the game a chance to reject this connection or modify the userinfo
if(!(SV_ClientConnect( ent, userinfo )))
{
@ -1380,6 +1385,7 @@ static void SV_ReadClientMove( sv_client_t *cl, sizebuf_t *msg )
int checksum1, checksum2;
int key, lastframe, net_drop;
usercmd_t oldest, oldcmd, newcmd, nulcmd;
bool paused;
key = msg->readcount;
checksum1 = MSG_ReadByte( msg );
@ -1390,7 +1396,7 @@ static void SV_ReadClientMove( sv_client_t *cl, sizebuf_t *msg )
cl->lastframe = lastframe;
if( cl->lastframe > 0 )
{
client_frame_t *frame = &cl->frames[cl->lastframe & UPDATE_MASK];
client_frame_t *frame = &cl->frames[cl->lastframe & SV_UPDATE_MASK];
frame->latency = svs.realtime - frame->senttime;
}
}
@ -1416,7 +1422,10 @@ static void SV_ReadClientMove( sv_client_t *cl, sizebuf_t *msg )
return;
}
if( !sv.paused )
// get client pause
paused = ( sv.paused || (( sv_maxclients->integer <= 1 ) && !CL_IsInGame( )));
if( !paused )
{
SV_PreRunCmd( cl, &newcmd ); // get random_seed from newcmd

View File

@ -201,15 +201,19 @@ For development work
*/
void SV_Map_f( void )
{
string filename;
char *spawn_entity;
string mapname;
int flags;
if( Cmd_Argc() != 2 )
{
Msg( "Usage: map <filename>\n" );
Msg( "Usage: map <mapname>\n" );
return;
}
// hold mapname to other place
com.strncpy( mapname, Cmd_Argv( 1 ), sizeof( mapname ));
// determine spawn entity classname
if( Cvar_VariableInteger( "deathmatch" ))
spawn_entity = GI->dm_entity;
@ -219,18 +223,26 @@ void SV_Map_f( void )
spawn_entity = GI->team_entity;
else spawn_entity = GI->sp_entity;
com.strncpy( filename, Cmd_Argv( 1 ), sizeof( filename ));
if( !SV_MapIsValid( filename, spawn_entity ))
flags = SV_MapIsValid( mapname, spawn_entity, NULL );
if(!( flags & MAP_IS_EXIST ))
{
Msg( "SV_NewMap: invalid map %s\n", filename );
Msg( "SV_NewMap: map %s doesn't exist\n", mapname );
return;
}
sv.loadgame = false; // set right state
if(!( flags & MAP_HAS_SPAWNPOINT ))
{
Msg( "SV_NewMap: map %s doesn't have a valid spawnpoint\n", mapname );
return;
}
if( svs.initialized ) SV_InitGame ();
SV_SpawnServer( filename, NULL );
SV_LevelInit( filename, NULL, NULL, false );
sv.loadgame = false; // set right state
SV_ClearSaveDir (); // delete all temporary *.hl files
if( svs.initialized ) SV_InitGame (); // clear old state
SV_SpawnServer( mapname, NULL );
SV_LevelInit( mapname, NULL, NULL, false );
SV_ActivateServer ();
}
@ -349,8 +361,10 @@ Saves the state of the map just being exited and goes to a new map.
*/
void SV_ChangeLevel_f( void )
{
char *spawn_entity;
int c = Cmd_Argc();
char *spawn_entity, *mapname;
int flags, c = Cmd_Argc();
mapname = Cmd_Argv( 1 );
// determine spawn entity classname
if( Cvar_VariableInteger( "deathmatch" ))
@ -361,16 +375,39 @@ void SV_ChangeLevel_f( void )
spawn_entity = GI->team_entity;
else spawn_entity = GI->sp_entity;
if( !SV_MapIsValid( Cmd_Argv( 1 ), spawn_entity ))
flags = SV_MapIsValid( mapname, spawn_entity, Cmd_Argv( 2 ));
if(!( flags & MAP_IS_EXIST ))
{
Msg( "SV_ChangeLevel: invalid map %s\n", Cmd_Argv( 1 ));
Msg( "SV_ChangeLevel: map %s doesn't exist\n", mapname );
return;
}
if( c == 3 && !( flags & MAP_HAS_LANDMARK ))
{
// NOTE: we find valid map but specified landmark it's doesn't exist
// run simple changelevel like in q1, throw warning
MsgDev( D_INFO, "SV_ChangeLevel: map %s is exist but doesn't contain\n", mapname );
MsgDev( D_INFO, "landmark with name %s. Run classic quake changelevel\n", Cmd_Argv( 2 ));
c = 2; // reduce args
}
if( c == 3 && !com.stricmp( sv.name, Cmd_Argv( 1 )))
{
MsgDev( D_INFO, "SV_ChangeLevel: can't changelevel with same map. Ignored.\n" );
return;
}
if( c == 2 && !( flags & MAP_HAS_SPAWNPOINT ))
{
MsgDev( D_INFO, "SV_ChangeLevel: map %s doesn't have a valid spawnpoint. Ignored.\n", mapname );
return;
}
if( sv.state != ss_active )
{
// just load map
Cbuf_AddText( va( "map %s\n", Cmd_Argv( 1 )));
Cbuf_AddText( va( "map %s\n", mapname ));
return;
}

View File

@ -323,7 +323,7 @@ void SV_WriteFrameToClient( sv_client_t *cl, sizebuf_t *msg )
int lastframe;
// this is the frame we are creating
frame = &cl->frames[sv.framenum & UPDATE_MASK];
frame = &cl->frames[sv.framenum & SV_UPDATE_MASK];
if( cl->lastframe <= 0 )
{
@ -331,7 +331,7 @@ void SV_WriteFrameToClient( sv_client_t *cl, sizebuf_t *msg )
oldframe = NULL;
lastframe = -1;
}
else if( sv.framenum - cl->lastframe >= (UPDATE_BACKUP - 3))
else if( sv.framenum - cl->lastframe >= (SV_UPDATE_BACKUP - 3))
{
// client hasn't gotten a good message through in a long time
oldframe = NULL;
@ -339,7 +339,7 @@ void SV_WriteFrameToClient( sv_client_t *cl, sizebuf_t *msg )
}
else
{ // we have a valid message to delta from
oldframe = &cl->frames[cl->lastframe & UPDATE_MASK];
oldframe = &cl->frames[cl->lastframe & SV_UPDATE_MASK];
lastframe = cl->lastframe;
// the snapshot's entities may still have rolled off the buffer, though
@ -410,7 +410,7 @@ void SV_BuildClientFrame( sv_client_t *cl )
sv.net_framenum++;
// this is the frame we are creating
frame = &cl->frames[sv.framenum & UPDATE_MASK];
frame = &cl->frames[sv.framenum & SV_UPDATE_MASK];
frame->senttime = svs.realtime; // save it for ping calc later
// clear everything in this snapshot

View File

@ -194,10 +194,10 @@ script_t *SV_GetEntityScript( const char *filename )
return ents;
}
bool SV_MapIsValid( const char *filename, const char *spawn_entity )
int SV_MapIsValid( const char *filename, const char *spawn_entity, const char *landmark_name )
{
script_t *ents = NULL;
bool result = false;
int flags = 0;
ents = SV_GetEntityScript( filename );
@ -206,31 +206,53 @@ bool SV_MapIsValid( const char *filename, const char *spawn_entity )
// if there are entities to parse, a missing message key just
// means there is no title, so clear the message string now
token_t token;
string check_entity;
string check_name;
bool need_landmark = com.strlen( landmark_name ) > 0 ? true : false;
if( host.developer >= 2 )
if( !need_landmark && host.developer >= 2 )
{
// not transition,
Com_CloseScript( ents );
return true; // skip playerstart serach in devmode
// skip spawnpoint checks in devmode
return (MAP_IS_EXIST|MAP_HAS_SPAWNPOINT);
}
check_entity[0] = 0;
flags |= MAP_IS_EXIST; // map is exist
while( Com_ReadToken( ents, SC_ALLOW_NEWLINES|SC_PARSE_GENERIC, &token ))
{
if( !com.strcmp( token.string, "classname" ))
{
// check classname for spawn entity
Com_ReadString( ents, false, check_entity );
if( !com.stricmp( spawn_entity, check_entity ))
Com_ReadString( ents, false, check_name );
if( !com.strcmp( spawn_entity, check_name ))
{
result = true;
break;
flags |= MAP_HAS_SPAWNPOINT;
// we already find landmark, stop the parsing
if( need_landmark && flags & MAP_HAS_LANDMARK )
break;
}
}
else if( need_landmark && !com.strcmp( token.string, "targetname" ))
{
// check targetname for landmark entity
Com_ReadString( ents, false, check_name );
if( !com.strcmp( landmark_name, check_name ))
{
flags |= MAP_HAS_LANDMARK;
// we already find spawnpoint, stop the parsing
if( flags & MAP_HAS_SPAWNPOINT )
break;
}
}
}
Com_CloseScript( ents );
}
return result;
return flags;
}
void SV_InitEdict( edict_t *pEdict )
@ -689,14 +711,13 @@ pfnChangeLevel
*/
void pfnChangeLevel( const char* s1, const char* s2 )
{
static int last_spawncount;
if( !s1 || s1[0] <= ' ' ) return;
// make sure we don't issue two changelevels
if( svs.spawncount == last_spawncount ) return;
if( svs.changelevel_next_time > svgame.globals->time )
return;
last_spawncount = svs.spawncount;
svs.changelevel_next_time = svgame.globals->time + 1.0f; // rest 1 secs if failed
if( !s2 ) Cbuf_AddText( va( "changelevel %s\n", s1 )); // Quake changlevel
else Cbuf_AddText( va( "changelevel %s %s\n", s1, s2 )); // Half-Life changelevel
@ -2564,6 +2585,7 @@ vaild map must contain one info_player_deatchmatch
int pfnIsMapValid( char *filename )
{
char *spawn_entity;
int flags;
// determine spawn entity classname
if( Cvar_VariableInteger( "deathmatch" ))
@ -2574,7 +2596,11 @@ int pfnIsMapValid( char *filename )
spawn_entity = GI->team_entity;
else spawn_entity = GI->sp_entity;
return SV_MapIsValid( filename, spawn_entity );
flags = SV_MapIsValid( filename, spawn_entity, NULL );
if(( flags & MAP_IS_EXIST ) && ( flags & MAP_HAS_SPAWNPOINT ))
return true;
return false;
}
/*

View File

@ -6,6 +6,8 @@
#include "common.h"
#include "server.h"
int SV_UPDATE_BACKUP = SINGLEPLAYER_BACKUP;
server_static_t svs; // persistant server info
svgame_static_t svgame; // persistant game info
server_t sv; // local server
@ -164,8 +166,6 @@ activate server on changed map, run physics
*/
void SV_ActivateServer( void )
{
int i;
if( !svs.initialized )
{
// probably server.dll doesn't loading
@ -183,12 +183,11 @@ void SV_ActivateServer( void )
// create a baseline for more efficient communications
SV_CreateBaseline();
sv.frametime = 0;
// run two frames to allow everything to settle
for( i = 0; i < 2; i++ )
{
sv.frametime = 100;
SV_Physics();
}
SV_Physics();
SV_Physics();
// invoke to refresh all movevars
Mem_Set( &svgame.oldmovevars, 0, sizeof( movevars_t ));
@ -223,6 +222,8 @@ deactivate server, free edicts stringtables etc
*/
void SV_DeactivateServer( void )
{
int i;
SV_FreeEdicts ();
sv.state = ss_dead;
@ -232,6 +233,15 @@ void SV_DeactivateServer( void )
svgame.dllFuncs.pfnServerDeactivate();
// set client fields on player ents
for( i = 0; i < svgame.globals->maxClients; i++ )
{
// free client frames
if( svs.clients[i].frames )
Mem_Free( svs.clients[i].frames );
svs.clients[i].frames = NULL;
}
svgame.globals->maxEntities = GI->max_edicts;
svgame.globals->maxClients = sv_maxclients->integer;
svgame.globals->numEntities = svgame.globals->maxClients + 1; // clients + world
@ -287,14 +297,12 @@ clients along with it.
================
*/
bool SV_SpawnServer( const char *server, const char *startspot )
bool SV_SpawnServer( const char *mapname, const char *startspot )
{
uint i, checksum;
int current_skill;
bool loadgame, paused;
Msg( "SpawnServer [^2%s^7]\n", server );
Cmd_ExecuteString( "latch\n" );
if( sv.state == ss_dead )
@ -305,6 +313,16 @@ bool SV_SpawnServer( const char *server, const char *startspot )
svs.timestart = Sys_Milliseconds();
svs.spawncount++; // any partially connected client will be restarted
svs.realtime = 0;
if( startspot )
{
Msg( "Spawn Server: %s [%s]\n", mapname, startspot );
}
else
{
Msg( "Spawn Server: %s\n", mapname );
}
// save state
loadgame = sv.loadgame;
@ -333,17 +351,19 @@ bool SV_SpawnServer( const char *server, const char *startspot )
// make cvars consistant
if( Cvar_VariableInteger( "coop" )) Cvar_SetValue( "deathmatch", 0 );
current_skill = Q_rint( Cvar_VariableValue( "skill" ));
if( current_skill < 0 ) current_skill = 0;
if( current_skill > 3 ) current_skill = 3;
current_skill = (int)(Cvar_VariableValue( "skill" ) + 0.5f);
current_skill = bound( 0, current_skill, 3 );
Cvar_SetValue( "skill", (float)current_skill );
sv.time = 1000;
sv.time = 1000; // server spawn time it's always 1.0 second
FS_FileBase( server, sv.name ); // make sure what server name doesn't contain path and extension
com.strncpy( sv.configstrings[CS_NAME], sv.name, CS_SIZE);
if( startspot ) com.strncpy( sv.startspot, startspot, sizeof( sv.startspot ));
// make sure what server name doesn't contain path and extension
FS_FileBase( mapname, sv.name );
com.strncpy( sv.configstrings[CS_NAME], sv.name, CS_SIZE );
if( startspot )
com.strncpy( sv.startspot, startspot, sizeof( sv.startspot ));
else sv.startspot[0] = '\0';
com.sprintf( sv.configstrings[CS_MODELS+1], "maps/%s.bsp", sv.name );
@ -351,10 +371,7 @@ bool SV_SpawnServer( const char *server, const char *startspot )
com.sprintf( sv.configstrings[CS_MAPCHECKSUM], "%i", checksum );
com.strncpy( sv.configstrings[CS_SKYNAME], "<skybox>", 64 );
if( CM_VisData() == NULL ) MsgDev( D_WARN, "map ^2%s^7 has no visibility\n", server );
// clear physics interaction links
SV_ClearWorld();
if( CM_VisData() == NULL ) MsgDev( D_WARN, "map ^2%s^7 has no visibility\n", mapname );
for( i = 1; i < CM_NumBmodels(); i++ )
{
@ -364,8 +381,13 @@ bool SV_SpawnServer( const char *server, const char *startspot )
// precache and static commands can be issued during map initialization
sv.state = ss_loading;
sv.paused = false;
Host_SetServerState( sv.state );
// clear physics interaction links
SV_ClearWorld();
return true;
}
@ -406,7 +428,7 @@ void SV_InitGame( void )
if( Cvar_VariableValue( "coop" ) && Cvar_VariableValue ( "deathmatch" ) && Cvar_VariableValue( "teamplay" ))
{
Msg("Deathmatch, Teamplay and Coop set, defaulting to Deathmatch\n");
MsgDev( D_WARN, "Deathmatch, Teamplay and Coop set, defaulting to Deathmatch\n");
Cvar_FullSet( "coop", "0", CVAR_SERVERINFO|CVAR_LATCH );
Cvar_FullSet( "teamplay", "0", CVAR_SERVERINFO|CVAR_LATCH );
}
@ -438,12 +460,18 @@ void SV_InitGame( void )
Cvar_FullSet( "sv_maxclients", "1", CVAR_SERVERINFO|CVAR_LATCH );
}
svgame.globals->maxClients = sv_maxclients->integer;
SV_UPDATE_BACKUP = ( svgame.globals->maxClients == 1 ) ? SINGLEPLAYER_BACKUP : MULTIPLAYER_BACKUP;
svs.spawncount = Com_RandomLong( 0, 65535 );
svs.clients = Z_Malloc( sizeof( sv_client_t ) * sv_maxclients->integer );
svs.num_client_entities = sv_maxclients->integer * UPDATE_BACKUP * 64; // g-cont: what a mem waster ???
svs.num_client_entities = sv_maxclients->integer * SV_UPDATE_BACKUP * 64; // g-cont: what a mem waster ???
svs.client_entities = Z_Malloc( sizeof( entity_state_t ) * svs.num_client_entities );
svs.baselines = Z_Malloc( sizeof( entity_state_t ) * GI->max_edicts );
// client frames will be allocated in SV_DirectConnect
// init network stuff
NET_Config(( sv_maxclients->integer > 1 ));
@ -468,10 +496,10 @@ void SV_InitGame( void )
svs.clients[i].edict = ent;
ent->pvServerData->client = svs.clients + i;
ent->pvServerData->client->edict = ent;
Mem_Set( &svs.clients[i].lastcmd, 0, sizeof( svs.clients[i].lastcmd ));
}
svgame.globals->numEntities = svgame.globals->maxClients + 1; // clients + world
svs.initialized = true;
}

View File

@ -70,11 +70,11 @@ void SV_CalcPings( void )
total = count = 0;
for( j = 0; j < (UPDATE_BACKUP / 2); j++ )
for( j = 0; j < (SV_UPDATE_BACKUP / 2); j++ )
{
client_frame_t *frame;
frame = &cl->frames[(cl->netchan.incoming_acknowledged - 1 - j) & UPDATE_MASK];
frame = &cl->frames[(cl->netchan.incoming_acknowledged - 1 - j) & SV_UPDATE_MASK];
if( frame->latency > 0 )
{
count++;
@ -107,11 +107,11 @@ int SV_CalcPacketLoss( sv_client_t *cl )
if( cl->edict->v.flags & FL_FAKECLIENT )
return 0;
numsamples = UPDATE_BACKUP / 2;
numsamples = SV_UPDATE_BACKUP / 2;
for( i = 0; i < numsamples; i++ )
{
frame = &cl->frames[(cl->netchan.incoming_acknowledged - 1 - i) & UPDATE_MASK];
frame = &cl->frames[(cl->netchan.incoming_acknowledged - 1 - i) & SV_UPDATE_MASK];
count++;
if( frame->latency == -1 )
lost++;
@ -288,7 +288,6 @@ if necessary
*/
void SV_CheckTimeouts( void )
{
sv_client_t *cl;
float droppoint;
float zombiepoint;
@ -363,6 +362,28 @@ void SV_PrepWorldFrame( void )
}
}
/*
================
SV_HasActivePlayers
returns true if server have spawned players
================
*/
bool SV_HasActivePlayers( void )
{
int i;
// server inactive
if( !svs.clients ) return false;
for( i = 0; i < sv_maxclients->integer; i++ )
{
if( svs.clients[i].state == cs_spawned )
return true;
}
return false;
}
/*
=================
SV_RunGameFrame
@ -376,6 +397,8 @@ void SV_RunGameFrame( void )
// has the "current" frame
sv.framenum++;
if( !SV_HasActivePlayers()) return;
// don't run if paused or not in game
if( !sv.paused && CL_IsInGame( ))
SV_Physics();
@ -593,7 +616,6 @@ void SV_Init( void )
SV_ClearSaveDir (); // delete all temporary *.hl files
MSG_Init( &net_message, net_message_buffer, sizeof( net_message_buffer ));
Host_CheckRestart ();
}

View File

@ -117,6 +117,7 @@ bool SV_WalkMove( edict_t *ent, const vec3_t move, int iMode )
{
trace_t trace;
vec3_t oldorg, neworg, end;
edict_t *groundent = NULL;
float flStepSize;
bool relink;
@ -141,7 +142,9 @@ bool SV_WalkMove( edict_t *ent, const vec3_t move, int iMode )
return false; // swim monster left water
VectorCopy( trace.vecEndPos, ent->v.origin );
SV_LinkEdict( ent, relink );
if( !VectorCompare( ent->v.origin, oldorg ))
SV_LinkEdict( ent, relink );
return true;
}
return false;
@ -181,7 +184,10 @@ bool SV_WalkMove( edict_t *ent, const vec3_t move, int iMode )
if( ent->v.flags & FL_PARTIALGROUND )
{
VectorAdd( ent->v.origin, move, ent->v.origin );
SV_LinkEdict( ent, relink );
if( !VectorCompare( ent->v.origin, oldorg ))
SV_LinkEdict( ent, relink );
ent->v.flags &= ~FL_ONGROUND;
return true;
}
@ -191,6 +197,19 @@ bool SV_WalkMove( edict_t *ent, const vec3_t move, int iMode )
// check point traces down for dangling corners
VectorCopy( trace.vecEndPos, ent->v.origin );
groundent = trace.pHit;
// check our pos
if( iMode == WALKMOVE_WORLDONLY )
trace = SV_Move( ent->v.origin, ent->v.mins, ent->v.maxs, ent->v.origin, MOVE_WORLDONLY, ent );
else trace = SV_Move( ent->v.origin, ent->v.mins, ent->v.maxs, ent->v.origin, MOVE_NORMAL|FTRACE_SIMPLEBOX, ent );
if( trace.fStartSolid )
{
VectorCopy( oldorg, ent->v.origin );
Msg( "WalkMove: start solid\n" );
return false;
}
if( !SV_CheckBottom( ent, flStepSize, iMode ))
{
@ -198,7 +217,8 @@ bool SV_WalkMove( edict_t *ent, const vec3_t move, int iMode )
{
// actor had floor mostly pulled out from underneath it
// and is trying to correct
SV_LinkEdict( ent, relink );
if( !VectorCompare( ent->v.origin, oldorg ))
SV_LinkEdict( ent, relink );
Msg( "WalkMove: partialground - ok\n" );
return true;
}
@ -212,10 +232,11 @@ bool SV_WalkMove( edict_t *ent, const vec3_t move, int iMode )
if( ent->v.flags & FL_PARTIALGROUND )
ent->v.flags &= ~FL_PARTIALGROUND;
ent->v.groundentity = trace.pHit;
ent->v.groundentity = groundent;
// the move is ok
SV_LinkEdict( ent, relink );
if( !VectorCompare( ent->v.origin, oldorg ))
SV_LinkEdict( ent, relink );
return true;
}

View File

@ -375,9 +375,9 @@ bool SV_CheckWater( edict_t *ent )
int cont;
vec3_t point;
point[0] = ent->v.origin[0];
point[1] = ent->v.origin[1];
point[2] = ent->v.origin[2] + ent->v.mins[2] + 1;
point[0] = (ent->v.absmin[0] + ent->v.absmax[0]) * 0.5f;
point[1] = (ent->v.absmin[1] + ent->v.absmax[1]) * 0.5f;
point[2] = ent->v.absmin[2] + 1;
ent->v.waterlevel = 0;
ent->v.watertype = CONTENTS_EMPTY;
@ -387,33 +387,44 @@ bool SV_CheckWater( edict_t *ent )
{
ent->v.watertype = cont;
ent->v.waterlevel = 1;
point[2] = ent->v.origin[2] + ( ent->v.mins[2] + ent->v.maxs[2] ) * 0.5f;
if( SV_PointContents( point ) <= CONTENTS_WATER )
// point sized entities are always fully submerged
if( ent->v.absmin[2] == ent->v.absmax[2] )
{
ent->v.waterlevel = 2;
point[2] = ent->v.origin[2] + ent->v.view_ofs[2];
ent->v.waterlevel = 3;
}
else
{
// check the exact center of the box
point[2] = (ent->v.absmin[2] + ent->v.absmax[2]) * 0.5f;
if( SV_PointContents( point ) <= CONTENTS_WATER )
ent->v.waterlevel = 3;
}
if( cont <= CONTENTS_CURRENT_0 && cont >= CONTENTS_CURRENT_DOWN )
{
static vec3_t current_table[] =
{
{ 1, 0, 0 },
{ 0, 1, 0 },
{-1, 0, 0 },
{ 0, -1, 0 },
{ 0, 0, 1 },
{ 0, 0, -1}
};
ent->v.waterlevel = 2;
point[2] = ent->v.origin[2] + ent->v.view_ofs[2];
float speed = ent->v.waterlevel * 50.0f;
float *dir = current_table[CONTENTS_CURRENT_0 - cont];
// now check where the eyes are...
if( SV_PointContents( point ) <= CONTENTS_WATER )
ent->v.waterlevel = 3;
}
VectorMA( ent->v.basevelocity, speed, dir, ent->v.basevelocity );
if( cont <= CONTENTS_CURRENT_0 && cont >= CONTENTS_CURRENT_DOWN )
{
static vec3_t current_table[] =
{
{ 1, 0, 0 },
{ 0, 1, 0 },
{-1, 0, 0 },
{ 0, -1, 0 },
{ 0, 0, 1 },
{ 0, 0, -1}
};
float speed = ent->v.waterlevel * 50.0f;
float *dir = current_table[CONTENTS_CURRENT_0 - cont];
VectorMA( ent->v.basevelocity, speed, dir, ent->v.basevelocity );
}
}
}
@ -744,6 +755,7 @@ void SV_AddGravity( edict_t *ent )
VectorClear( ent->v.velocity );
return;
}
if( ent->v.gravity ) // gravity modifier
ent->v.velocity[2] -= sv_gravity->value * ent->v.gravity * svgame.globals->frametime;
else ent->v.velocity[2] -= sv_gravity->value * svgame.globals->frametime;
@ -1796,10 +1808,19 @@ void SV_Physics_Step_RunTimestep( edict_t *ent, float timestep )
isfalling = true;
}
}
else
else if( ent->v.waterlevel > 0 )
{
ent->v.velocity[2] += (ent->v.skin * ent->v.waterlevel) * timestep;
Msg( "velocity %g %g\n", ent->v.velocity[2] );
if( ent->v.waterlevel > 1 )
{
VectorScale( ent->v.velocity, 0.9f, ent->v.velocity );
ent->v.velocity[2] += (ent->v.skin * timestep);
}
else if( ent->v.waterlevel == 1 )
{
if( ent->v.velocity[2] > 0.0f )
ent->v.velocity[2] = timestep;
ent->v.velocity[2] -= (ent->v.skin * timestep);
}
}
}
}
@ -1886,38 +1907,11 @@ void SV_Physics_Step_RunTimestep( edict_t *ent, float timestep )
void SV_Physics_Step( edict_t *ent )
{
float dt, thinktime, deltaThink;
svgame.globals->time = sv.time * 0.001f;
// regular thinking
if( !SV_RunThink( ent )) return;
thinktime = ent->v.nextthink;
deltaThink = thinktime - svgame.globals->time;
if( thinktime <= 0.0f || deltaThink > 0.5f )
{
SV_Physics_Step_RunTimestep( ent, svgame.globals->frametime );
SV_CheckWaterTransition( ent );
ent->v.nextthink = svgame.globals->time;
return;
}
// not going to think, don't run physics either
if( thinktime > svgame.globals->frametime )
return;
// Don't let things stay in the past.
// it is possible to start that way
// by a trigger with a local time.
if( thinktime < svgame.globals->time )
thinktime = svgame.globals->time;
// simulate over the timestep
dt = thinktime - ent->v.nextthink;
SV_Physics_Step_RunTimestep( ent, dt );
SV_Physics_Step_RunTimestep( ent, svgame.globals->frametime );
if( !SV_RunThink( ent )) return;
SV_CheckWaterTransition( ent );
}
@ -2120,19 +2114,19 @@ void SV_Physics( void )
}
// treat each object in turn
for( i = svgame.globals->maxClients + 1; !sv_playersonly->integer && i < svgame.globals->numEntities; i++ )
if( !sv_playersonly->integer )
{
ent = EDICT_NUM( i );
if( ent->free ) continue;
SV_Physics_Entity( ent );
for( i = svgame.globals->maxClients + 1; i < svgame.globals->numEntities; i++ )
{
ent = EDICT_NUM( i );
if( ent->free ) continue;
SV_Physics_Entity( ent );
}
}
// let everything in the world think and move
CM_Frame( svgame.globals->frametime );
svgame.globals->time = sv.time * 0.001f;
// at end of frame kill all entities which supposed to it
SV_FreeOldEntities();

View File

@ -1161,7 +1161,7 @@ void SV_LoadAdjacentEnts( const char *pOldLevel, const char *pLandmarkName )
// map was already in the list
if( test < i ) continue;
MsgDev( D_INFO, "Merging entities from %s ( at %s )\n", currentLevelData.levelList[i].mapName, currentLevelData.levelList[i].landmarkName );
MsgDev( D_NOTE, "Merging entities from %s ( at %s )\n", currentLevelData.levelList[i].mapName, currentLevelData.levelList[i].landmarkName );
pSaveData = SV_LoadSaveData( currentLevelData.levelList[i].mapName );
if( pSaveData )

View File

@ -357,7 +357,7 @@ uint Cmd_Argc (void)
Cmd_Argv
============
*/
char *Cmd_Argv ( uint arg )
char *Cmd_Argv( uint arg )
{
if( arg >= cmd_argc )
return "";

View File

@ -1,16 +0,0 @@
<html>
<body>
<pre>
<h1>Build Log</h1>
<h3>
--------------------Configuration: launch - Win32 Debug--------------------
</h3>
<h3>Command Lines</h3>
<h3>Results</h3>
launch.dll - 0 error(s), 0 warning(s)
</pre>
</body>
</html>

View File

@ -814,7 +814,8 @@ void CPushable :: Move( CBaseEntity *pOther, int push )
// Don't push unless the player is pushing forward and NOT use (pull)
if ( push && !(pevToucher->button & (IN_FORWARD|IN_MOVERIGHT|IN_MOVELEFT|IN_BACK)) )
return;
if ( !push && (pevToucher->button & (IN_FORWARD)) ) return;
if ( !push && !(pevToucher->button & IN_BACK) )
return;
playerTouch = 1;
}

View File

@ -1,16 +0,0 @@
<html>
<body>
<pre>
<h1>Build Log</h1>
<h3>
--------------------Configuration: server - Win32 Debug--------------------
</h3>
<h3>Command Lines</h3>
<h3>Results</h3>
server.dll - 0 error(s), 0 warning(s)
</pre>
</body>
</html>

View File

@ -1,16 +0,0 @@
<html>
<body>
<pre>
<h1>Build Log</h1>
<h3>
--------------------Configuration: snd_al - Win32 Debug--------------------
</h3>
<h3>Command Lines</h3>
<h3>Results</h3>
snd_al.dll - 0 error(s), 0 warning(s)
</pre>
</body>
</html>

View File

@ -1,16 +0,0 @@
<html>
<body>
<pre>
<h1>Build Log</h1>
<h3>
--------------------Configuration: snd_dx - Win32 Debug--------------------
</h3>
<h3>Command Lines</h3>
<h3>Results</h3>
snd_dx.dll - 0 error(s), 0 warning(s)
</pre>
</body>
</html>

View File

@ -1144,10 +1144,9 @@ void CPushable :: Move( CBaseEntity *pOther, int push )
if ( pOther->IsPlayer() )
{
if ( push && !(pevToucher->button & (IN_FORWARD|IN_USE)) ) // Don't push unless the player is pushing forward and NOT use (pull)
if ( push && !(pevToucher->button & (IN_FORWARD|IN_MOVERIGHT|IN_MOVELEFT|IN_BACK)) )
return;
if ( !push && (pevToucher->button & (IN_FORWARD)) ) // this is fix for old Half-Life bug with pushable acceleration
if ( !push && !(pevToucher->button & IN_BACK) )
return;
playerTouch = 1;
}

View File

@ -1,16 +0,0 @@
<html>
<body>
<pre>
<h1>Build Log</h1>
<h3>
--------------------Configuration: spirit - Win32 Debug--------------------
</h3>
<h3>Command Lines</h3>
<h3>Results</h3>
server.dll - 0 error(s), 0 warning(s)
</pre>
</body>
</html>

View File

@ -28,4 +28,5 @@ Xash 0.71 Beta 05.05.10
4. revision server physic
5. revision monster moving
6. fix save\restore global state OK
7. rewrite WalkMove
7. rewrite WalkMove OK
8. tune UPDATE_BACKUP value for singleplayer

View File

@ -1017,14 +1017,17 @@ static bool R_VertexTCBase( const ref_stage_t *pass, int unit, matrix4x4 matrix
GL_SetTexCoordArrayMode( 0 );
Matrix4x4_Copy( matrix, RI.worldviewProjectionMatrix );
// nonmoving objects using worldviewmatrix
if( VectorIsNull( RI.currententity->origin ) && Matrix3x3_Compare( RI.currententity->axis, matrix3x3_identity ))
Matrix4x4_Copy( matrix, RI.worldviewProjectionMatrix );
else Matrix4x4_Concat( matrix, RI.projectionMatrix, RI.modelviewMatrix );
Matrix4x4_LoadIdentity( m1 );
Matrix4x4_ConcatScale( m1, 0.5 );
Matrix4x4_ConcatScale( m1, 0.5f );
Matrix4x4_Concat( m2, m1, matrix );
Matrix4x4_LoadIdentity( m1 );
Matrix4x4_ConcatTranslate( m1, 0.5, 0.5, 0.5 );
Matrix4x4_ConcatTranslate( m1, 0.5f, 0.5f, 0.5f );
Matrix4x4_Concat( matrix, m1, m2 );
for( i = 0; i < 4; i++ )

View File

@ -1372,13 +1372,13 @@ static void R_CullEntities( void )
if( !e->model ) break;
switch( e->model->type )
{
case mod_world:
case mod_brush:
culled = R_CullBrushModel( e );
break;
case mod_studio:
culled = R_CullStudioModel( e );
break;
case mod_brush:
case mod_world:
culled = R_CullBrushModel( e );
break;
case mod_sprite:
culled = R_CullSpriteModel( e );
break;
@ -2327,8 +2327,6 @@ bool R_AddLightStyle( int stylenum, vec3_t color )
bool R_AddGenericEntity( edict_t *pRefEntity, ref_entity_t *refent )
{
vec3_t center;
// check model
if( !refent->model ) return false;
@ -2361,9 +2359,8 @@ bool R_AddGenericEntity( edict_t *pRefEntity, ref_entity_t *refent )
refent->rtype = RT_MODEL;
// setup light origin
if( refent->model ) VectorAverage( refent->model->mins, refent->model->maxs, center );
else VectorClear( center );
VectorAdd( pRefEntity->v.origin, center, refent->lightingOrigin );
VectorCopy( pRefEntity->v.origin, refent->lightingOrigin );
refent->lightingOrigin[2] += 1;
// do animate
if( refent->flags & EF_ANIMATE )
@ -2432,6 +2429,7 @@ bool R_AddGenericEntity( edict_t *pRefEntity, ref_entity_t *refent )
{
refent->gaitsequence = pRefEntity->v.gaitsequence;
refent->flags |= EF_OCCLUSIONTEST;
refent->lightingOrigin[2] += refent->model->maxs[2] - 2; // drop shadow to floor
}
else refent->gaitsequence = 0;

View File

@ -889,7 +889,7 @@ static bool R_AddPortalSurface( const meshbuffer_t *mb )
plane = oplane;
}
if( ( dist = PlaneDiff( RI.viewOrigin, &plane ) ) <= BACKFACE_EPSILON )
if(( dist = PlaneDiff( RI.viewOrigin, &plane ) ) <= BACKFACE_EPSILON )
{
if( !( shader->flags & SHADER_PORTAL_CAPTURE2 ))
return true;

View File

@ -455,7 +455,7 @@ bool R_CreateWindow( int width, int height, bool fullscreen )
int exstyle = 0;
static string wndname;
com.snprintf( wndname, sizeof( wndname ), "%s %g", GI->title, GI->version );
com.snprintf( wndname, sizeof( wndname ), "%s", GI->title );
// register the frame class
wc.style = 0;

View File

@ -252,16 +252,16 @@ bool R_AddShadowCaster( ref_entity_t *ent )
return false;
VectorCopy( ent->lightingOrigin, origin );
if( VectorCompare( origin, vec3_origin ) )
if( VectorIsNull( origin ))
return false;
// find lighting group containing entities with same lightingOrigin as ours
hash_key = (unsigned int)( origin[0] * 7 + origin[1] * 5 + origin[2] * 3 );
hash_key &= ( SHADOWGROUPS_HASH_SIZE-1 );
hash_key = (uint)( origin[0] * 7 + origin[1] * 5 + origin[2] * 3 );
hash_key &= (SHADOWGROUPS_HASH_SIZE - 1);
for( group = r_shadowGroups_hash[hash_key]; group; group = group->hashNext )
{
if( VectorCompare( group->origin, origin ) )
if( VectorCompare( group->origin, origin ))
goto add; // found an existing one, add
}
@ -356,16 +356,17 @@ R_CullShadowmapGroups
*/
void R_CullShadowmapGroups( void )
{
int i, j;
vec3_t mins, maxs;
shadowGroup_t *group;
int i, j;
vec3_t mins, maxs;
shadowGroup_t *group;
if( RI.refdef.flags & RDF_NOWORLDMODEL )
return;
memset( r_shadowCullBits, 0, sizeof( r_shadowCullBits ) );
Mem_Set( r_shadowCullBits, 0, sizeof( r_shadowCullBits ));
for( i = 0, group = r_shadowGroups; i < r_numShadowGroups; i++, group++ ) {
for( i = 0, group = r_shadowGroups; i < r_numShadowGroups; i++, group++ )
{
for( j = 0; j < 3; j++ )
{
mins[j] = group->origin[j] - group->projDist * 1.75 * 0.5 * 0.5;
@ -374,15 +375,16 @@ void R_CullShadowmapGroups( void )
// check if view point is inside the bounding box...
for( j = 0; j < 3; j++ )
{
if( RI.viewOrigin[j] < mins[j] || RI.viewOrigin[j] > maxs[j] )
break;
if( j == 3 )
continue; // ...it is, so trivially accept
}
if( j == 3 ) continue; // ...it is, so trivially accept
if( R_CullBox( mins, maxs, RI.clipFlags ) )
r_shadowCullBits[i>>3] |= (1<<(i&7)); // trivially reject
else if( OCCLUSION_QUERIES_ENABLED( RI ) )
r_shadowCullBits[i>>3] |= (1<<(i&7)); // trivially reject
else if( OCCLUSION_QUERIES_ENABLED( RI ))
R_IssueOcclusionQuery( R_GetOcclusionQueryNum( OQ_SHADOWGROUP, i ), r_worldent, mins, maxs );
}
}

View File

@ -235,6 +235,7 @@ void R_AddBrushModelToList( ref_entity_t *e )
rotated = !Matrix3x3_Compare( e->axis, matrix3x3_identity );
VectorSubtract( RI.refdef.vieworg, e->origin, modelorg );
if( rotated )
{
vec3_t temp;
@ -255,18 +256,18 @@ void R_AddBrushModelToList( ref_entity_t *e )
for( i = 0, psurf = bmodel->firstmodelsurface; i < (unsigned)bmodel->nummodelsurfaces; i++, psurf++ )
{
if( !R_SurfPotentiallyVisible( psurf ) )
if( !R_SurfPotentiallyVisible( psurf ))
continue;
if( RI.params & RP_SHADOWMAPVIEW )
{
if( psurf->visframe != r_framecount )
continue;
if( ( psurf->shader->sort >= SORT_OPAQUE ) && ( psurf->shader->sort <= SORT_BANNER ) )
if(( psurf->shader->sort >= SORT_OPAQUE ) && ( psurf->shader->sort <= SORT_BANNER ))
{
if( prevRI.surfmbuffers[psurf - r_worldbrushmodel->surfaces] )
{
if( !R_CullSurface( psurf, 0 ) )
if( !R_CullSurface( psurf, 0 ))
{
RI.params |= RP_WORLDSURFVISIBLE;
prevRI.surfmbuffers[psurf - r_worldbrushmodel->surfaces]->shadowbits |= RI.shadowGroup->bit;

View File

@ -1,16 +0,0 @@
<html>
<body>
<pre>
<h1>Build Log</h1>
<h3>
--------------------Configuration: vid_gl - Win32 Debug--------------------
</h3>
<h3>Command Lines</h3>
<h3>Results</h3>
vid_gl.dll - 0 error(s), 0 warning(s)
</pre>
</body>
</html>

View File

@ -1,102 +0,0 @@
<html>
<body>
<pre>
<h1>Build Log</h1>
<h3>
--------------------Configuration: xtools - Win32 Debug--------------------
</h3>
<h3>Command Lines</h3>
Creating temporary file "C:\DOCUME~1\ÌÈØÀ\LOCALS~1\Temp\RSPBD4.tmp" with contents
[
/nologo /MDd /W3 /Gm /Gi /GX /ZI /Od /I "./" /I "../public" /I "bsplib" /I "models" /I "ripper" /I "../common" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FR"..\temp\xtools\!debug/" /Fo"..\temp\xtools\!debug/" /Fd"..\temp\xtools\!debug/" /FD /GZ /c
"D:\Xash3D\src_main\xtools\bsplib\map.c"
]
Creating command line "cl.exe @"C:\DOCUME~1\ÌÈØÀ\LOCALS~1\Temp\RSPBD4.tmp""
Creating temporary file "C:\DOCUME~1\ÌÈØÀ\LOCALS~1\Temp\RSPBD5.tmp" with contents
[
msvcrtd.lib user32.lib /nologo /dll /incremental:yes /pdb:"..\temp\xtools\!debug/xtools.pdb" /debug /machine:I386 /nodefaultlib:"libc.lib" /out:"..\temp\xtools\!debug/xtools.dll" /implib:"..\temp\xtools\!debug/xtools.lib" /pdbtype:sept
"\Xash3D\src_main\temp\xtools\!debug\brush.obj"
"\Xash3D\src_main\temp\xtools\!debug\brush_primit.obj"
"\Xash3D\src_main\temp\xtools\!debug\bsp.obj"
"\Xash3D\src_main\temp\xtools\!debug\bspfile_abstract.obj"
"\Xash3D\src_main\temp\xtools\!debug\bspfile_ibsp.obj"
"\Xash3D\src_main\temp\xtools\!debug\bspfile_rbsp.obj"
"\Xash3D\src_main\temp\xtools\!debug\bsplib.obj"
"\Xash3D\src_main\temp\xtools\!debug\conv_bsplumps.obj"
"\Xash3D\src_main\temp\xtools\!debug\conv_doom.obj"
"\Xash3D\src_main\temp\xtools\!debug\conv_image.obj"
"\Xash3D\src_main\temp\xtools\!debug\conv_main.obj"
"\Xash3D\src_main\temp\xtools\!debug\conv_shader.obj"
"\Xash3D\src_main\temp\xtools\!debug\conv_sprite.obj"
"\Xash3D\src_main\temp\xtools\!debug\convert_ase.obj"
"\Xash3D\src_main\temp\xtools\!debug\convert_map.obj"
"\Xash3D\src_main\temp\xtools\!debug\decals.obj"
"\Xash3D\src_main\temp\xtools\!debug\facebsp.obj"
"\Xash3D\src_main\temp\xtools\!debug\fog.obj"
"\Xash3D\src_main\temp\xtools\!debug\image.obj"
"\Xash3D\src_main\temp\xtools\!debug\leakfile.obj"
"\Xash3D\src_main\temp\xtools\!debug\light.obj"
"\Xash3D\src_main\temp\xtools\!debug\light_bounce.obj"
"\Xash3D\src_main\temp\xtools\!debug\light_trace.obj"
"\Xash3D\src_main\temp\xtools\!debug\light_ydnar.obj"
"\Xash3D\src_main\temp\xtools\!debug\lightmaps_ydnar.obj"
"\Xash3D\src_main\temp\xtools\!debug\map.obj"
"\Xash3D\src_main\temp\xtools\!debug\md5.obj"
"\Xash3D\src_main\temp\xtools\!debug\mesh.obj"
"\Xash3D\src_main\temp\xtools\!debug\model.obj"
"\Xash3D\src_main\temp\xtools\!debug\patch.obj"
"\Xash3D\src_main\temp\xtools\!debug\picointernal.obj"
"\Xash3D\src_main\temp\xtools\!debug\picomodel.obj"
"\Xash3D\src_main\temp\xtools\!debug\picomodules.obj"
"\Xash3D\src_main\temp\xtools\!debug\pm_3ds.obj"
"\Xash3D\src_main\temp\xtools\!debug\pm_ase.obj"
"\Xash3D\src_main\temp\xtools\!debug\pm_fm.obj"
"\Xash3D\src_main\temp\xtools\!debug\pm_md2.obj"
"\Xash3D\src_main\temp\xtools\!debug\pm_md3.obj"
"\Xash3D\src_main\temp\xtools\!debug\pm_mdc.obj"
"\Xash3D\src_main\temp\xtools\!debug\pm_ms3d.obj"
"\Xash3D\src_main\temp\xtools\!debug\pm_obj.obj"
"\Xash3D\src_main\temp\xtools\!debug\polylib.obj"
"\Xash3D\src_main\temp\xtools\!debug\portals.obj"
"\Xash3D\src_main\temp\xtools\!debug\prtfile.obj"
"\Xash3D\src_main\temp\xtools\!debug\shaders.obj"
"\Xash3D\src_main\temp\xtools\!debug\spritegen.obj"
"\Xash3D\src_main\temp\xtools\!debug\studio.obj"
"\Xash3D\src_main\temp\xtools\!debug\studio_utils.obj"
"\Xash3D\src_main\temp\xtools\!debug\surface.obj"
"\Xash3D\src_main\temp\xtools\!debug\surface_extra.obj"
"\Xash3D\src_main\temp\xtools\!debug\surface_foliage.obj"
"\Xash3D\src_main\temp\xtools\!debug\surface_fur.obj"
"\Xash3D\src_main\temp\xtools\!debug\surface_meta.obj"
"\Xash3D\src_main\temp\xtools\!debug\tjunction.obj"
"\Xash3D\src_main\temp\xtools\!debug\tree.obj"
"\Xash3D\src_main\temp\xtools\!debug\utils.obj"
"\Xash3D\src_main\temp\xtools\!debug\vis.obj"
"\Xash3D\src_main\temp\xtools\!debug\visflow.obj"
"\Xash3D\src_main\temp\xtools\!debug\wadlib.obj"
"\Xash3D\src_main\temp\xtools\!debug\writebsp.obj"
"\Xash3D\src_main\temp\xtools\!debug\ximage.obj"
"\Xash3D\src_main\temp\xtools\!debug\xtools.obj"
]
Creating command line "link.exe @"C:\DOCUME~1\ÌÈØÀ\LOCALS~1\Temp\RSPBD5.tmp""
Creating temporary file "C:\DOCUME~1\ÌÈØÀ\LOCALS~1\Temp\RSPBD6.bat" with contents
[
@echo off
copy \Xash3D\src_main\temp\xtools\!debug\xtools.dll "D:\Xash3D\bin\xtools.dll"
]
Creating command line ""C:\DOCUME~1\ÌÈØÀ\LOCALS~1\Temp\RSPBD6.bat""
Compiling...
map.c
Linking...
Creating library ..\temp\xtools\!debug/xtools.lib and object ..\temp\xtools\!debug/xtools.exp
<h3>Output Window</h3>
Performing Custom Build Step on \Xash3D\src_main\temp\xtools\!debug\xtools.dll
‘ª®¯¨à®¢ ­® ä ©«®¢: 1.
<h3>Results</h3>
xtools.dll - 0 error(s), 0 warning(s)
</pre>
</body>
</html>