15 Aug 2017

This commit is contained in:
g-cont 2017-08-15 00:00:00 +03:00 committed by Alibek Omarov
parent 289440133b
commit af22363f14
31 changed files with 203 additions and 122 deletions

View File

@ -95,7 +95,7 @@ BRUSH MODELS
#define MAX_MAP_TEXTURES 2048 // can be increased but not needed
#define MAX_MAP_MIPTEX 0x2000000 // 32 Mb internal textures data
#define MAX_MAP_LIGHTING 0x2000000 // 32 Mb lightmap raw data (can contain deluxemaps)
#define MAX_MAP_VISIBILITY 0x800000 // 8 Mb visdata
#define MAX_MAP_VISIBILITY 0x1000000 // 16 Mb visdata
// quake lump ordering
#define LUMP_ENTITIES 0

View File

@ -1173,9 +1173,6 @@ void CL_LinkPacketEntities( frame_t *frame )
// NOTE: never pass sprites with rendercolor '0 0 0' it's a stupid Valve Hammer Editor bug
if( !ent->curstate.rendercolor.r && !ent->curstate.rendercolor.g && !ent->curstate.rendercolor.b )
ent->curstate.rendercolor.r = ent->curstate.rendercolor.g = ent->curstate.rendercolor.b = 255;
if( ent->model->type == mod_sprite )
R_SetSpriteRenderamt( ent, ent->model );
}
if( ent->curstate.aiment != 0 && ent->curstate.movetype != MOVETYPE_COMPOUND )

View File

@ -371,9 +371,7 @@ static HIMAGE pfnPIC_Load( const char *szPicName, const byte *image_buf, long im
// add default parms to image
flags |= TF_IMAGE;
host.decal_loading = true; // allow decal images for menu
tx = GL_LoadTexture( szPicName, image_buf, image_size, flags, NULL );
host.decal_loading = false;
return tx;
}

View File

@ -580,10 +580,7 @@ Set new weapon animation
void CL_WeaponAnim( int iAnim, int body )
{
cl_entity_t *view = &clgame.viewent;
#if 0
if( CL_LocalWeapons() && cl.local.repredicting )
return;
#endif
cl.local.weaponstarttime = 0.0f;
cl.local.weaponsequence = iAnim;
view->curstate.framerate = 1.0f;

View File

@ -93,20 +93,6 @@ qboolean CL_IsPredicted( void )
return true;
}
/*
===============
CL_LocalWeapons
===============
*/
qboolean CL_LocalWeapons( void )
{
if( cl.intermission )
return false;
if( cl_lw && cl_lw->value )
return true;
return false;
}
/*
===============
CL_SetLastUpdate
@ -1153,14 +1139,14 @@ void CL_RunUsercmd( local_state_t *from, local_state_t *to, usercmd_t *u, qboole
memset( &temp, 0, sizeof( temp ));
while( u->msec > 50 )
if( u->msec > 50 )
{
split = *u;
split.msec /= 2;
CL_RunUsercmd( from, &temp, &split, runfuncs, time, random_seed );
split.impulse = split.weaponselect = 0;
from = &temp;
u = &split;
CL_RunUsercmd( &temp, to, &split, runfuncs, time, random_seed );
return;
}
cmd = *u; // deal with local copy
@ -1182,8 +1168,7 @@ void CL_RunUsercmd( local_state_t *from, local_state_t *to, usercmd_t *u, qboole
else cl.local.lastground = clgame.pmove->onground; // world(0) or in air(-1)
}
if( CL_LocalWeapons( ))
clgame.dllFuncs.pfnPostRunCmd( from, to, &cmd, runfuncs, *time, random_seed );
clgame.dllFuncs.pfnPostRunCmd( from, to, &cmd, runfuncs, *time, random_seed );
*time += (double)cmd.msec / 1000.0;
}
@ -1261,15 +1246,6 @@ void CL_PredictMovement( qboolean repredicting )
if( FBitSet( frame->clientdata.flags, FL_ONGROUND ))
cl.local.onground = frame->playerstate[cl.playernum].onground;
else cl.local.onground = -1;
// we need to perform cl_lw prediction while cl_predict is disabled
// because cl_lw is enabled by default in Half-Life
if( !CL_LocalWeapons( ))
{
cl.local.viewmodel = frame->clientdata.viewmodel;
cl.local.moving = false;
return;
}
}
from = &cl.predicted_frames[cl.parsecountmod];
@ -1328,7 +1304,8 @@ void CL_PredictMovement( qboolean repredicting )
cl.local.onground = frame->playerstate[cl.playernum].onground;
else cl.local.onground = -1;
cl.local.viewmodel = to->client.viewmodel;
if( !repredicting || !cl_lw->value )
cl.local.viewmodel = to->client.viewmodel;
cl.local.repredicting = false;
cl.local.moving = false;
return;
@ -1367,7 +1344,8 @@ void CL_PredictMovement( qboolean repredicting )
cl.local.waterlevel = to->client.waterlevel;
cl.local.usehull = to->playerstate.usehull;
if( !repredicting ) cl.local.viewmodel = to->client.viewmodel;
if( !repredicting || !cl_lw->value )
cl.local.viewmodel = to->client.viewmodel;
if( FBitSet( to->client.flags, FL_ONGROUND ))
{

View File

@ -309,13 +309,17 @@ void SCR_BeginLoadingPlaque( qboolean is_background )
S_StopAllSounds( true );
cl.audio_prepped = false; // don't play ambients
if( CL_IsInMenu( ) && !cls.changedemo && !is_background )
{
UI_SetActiveMenu( false );
if( cls.state == ca_disconnected )
SCR_UpdateScreen();
}
if( cls.disable_screen ) return; // already set
if( cls.state == ca_disconnected ) return; // if at console, don't bring up the plaque
if( cls.key_dest == key_console ) return;
if( CL_IsInMenu( ) && !cls.changedemo && !is_background )
UI_SetActiveMenu( false );
cls.draw_changelevel = is_background ? false : true;
SCR_UpdateScreen();
cls.disable_screen = host.realtime;

View File

@ -1546,6 +1546,8 @@ void R_Projectile( const vec3_t origin, const vec3_t velocity, int modelIndex, i
pTemp = CL_TempEntAllocHigh( origin, Mod_Handle( modelIndex ));
if( !pTemp ) return;
VectorCopy( velocity, pTemp->entity.baseline.origin );
if( Mod_GetType( modelIndex ) == mod_sprite )
{
pTemp->flags |= FTENT_SPRANIMATE;
@ -1563,13 +1565,11 @@ void R_Projectile( const vec3_t origin, const vec3_t velocity, int modelIndex, i
else
{
pTemp->frameMax = 0;
VectorCopy( velocity, pTemp->entity.baseline.origin );
VectorNormalize2( velocity, dir );
VectorAngles( dir, pTemp->entity.angles );
}
pTemp->flags = FTENT_COLLIDEALL|FTENT_PERSIST|FTENT_COLLIDEKILL;
pTemp->flags |= FTENT_COLLIDEALL|FTENT_PERSIST|FTENT_COLLIDEKILL;
pTemp->entity.baseline.renderamt = 255;
pTemp->hitcallback = hitcallback;
pTemp->die = cl.time + life;
@ -2313,7 +2313,7 @@ void CL_ParseTempEntity( sizebuf_t *msg )
pos2[1] = MSG_ReadCoord( &buf );
pos2[2] = MSG_ReadCoord( &buf );
modelIndex = MSG_ReadShort( &buf );
life = (float)(MSG_ReadByte( &buf ) * 0.1f);
life = MSG_ReadByte( &buf );
color = MSG_ReadByte( &buf ); // playernum
R_Projectile( pos, pos2, modelIndex, life, color, NULL );
break;
@ -2892,7 +2892,6 @@ int CL_DecalIndex( int id )
{
id = bound( 0, id, MAX_DECALS - 1 );
host.decal_loading = true;
if( !cl.decal_index[id] )
{
qboolean load_external = false;
@ -2928,7 +2927,6 @@ int CL_DecalIndex( int id )
if( !load_external ) cl.decal_index[id] = GL_LoadTexture( host.draw_decals[id], NULL, 0, TF_DECAL, NULL );
}
host.decal_loading = false;
return cl.decal_index[id];
}

View File

@ -92,6 +92,7 @@ void V_SetupViewModel( void )
view->model = Mod_Handle( cl.local.viewmodel );
view->curstate.modelindex = cl.local.viewmodel;
view->curstate.sequence = cl.local.weaponsequence;
view->curstate.rendermode = kRenderNormal; // EXPERIMENTAL!!!
// alias models has another animation methods
if( view->model && view->model->type == mod_studio )

View File

@ -814,7 +814,6 @@ void CL_SetupPMove( playermove_t *pmove, local_state_t *from, usercmd_t *ucmd, q
pmtrace_t *CL_VisTraceLine( vec3_t start, vec3_t end, int flags );
pmtrace_t CL_TraceLine( vec3_t start, vec3_t end, int flags );
void CL_MoveSpectatorCamera( void );
qboolean CL_LocalWeapons( void );
void CL_SetLastUpdate( void );
void CL_RedoPrediction( void );
void CL_ClearPhysEnts( void );

View File

@ -881,9 +881,9 @@ void R_AliasDynamicLight( cl_entity_t *ent, alight_t *plight )
{
VectorSet( lightDir, mv->skyvec_x, mv->skyvec_y, mv->skyvec_z );
light.r = mv->skycolor_r;
light.g = mv->skycolor_g;
light.b = mv->skycolor_b;
light.r = LightToTexGamma( bound( 0, mv->skycolor_r, 255 ));
light.g = LightToTexGamma( bound( 0, mv->skycolor_g, 255 ));
light.b = LightToTexGamma( bound( 0, mv->skycolor_b, 255 ));
}
}
@ -960,9 +960,9 @@ void R_AliasDynamicLight( cl_entity_t *ent, alight_t *plight )
VectorAdd( lightDir, dist, lightDir );
finalLight[0] += LightToTexGamma( dl->color.r ) * ( add / 256.0f );
finalLight[1] += LightToTexGamma( dl->color.g ) * ( add / 256.0f );
finalLight[2] += LightToTexGamma( dl->color.b ) * ( add / 256.0f );
finalLight[0] += LightToTexGamma( dl->color.r ) * ( add * 512.0f );
finalLight[1] += LightToTexGamma( dl->color.g ) * ( add * 512.0f );
finalLight[2] += LightToTexGamma( dl->color.b ) * ( add * 512.0f );
}
}

View File

@ -1856,6 +1856,40 @@ static rgbdata_t *R_InitDefaultTexture( texFlags_t *flags )
return &r_image;
}
/*
==================
R_InitParticleTexture
==================
*/
static rgbdata_t *R_InitParticleTexture( texFlags_t *flags )
{
int x, y;
int dx2, dy, d;
// particle texture
r_image.width = r_image.height = 16;
r_image.buffer = data2D;
r_image.flags = (IMAGE_HAS_COLOR|IMAGE_HAS_ALPHA);
r_image.type = PF_RGBA_32;
r_image.size = r_image.width * r_image.height * 4;
*flags = TF_UNCOMPRESSED|TF_CLAMP;
for( x = 0; x < 16; x++ )
{
dx2 = x - 8;
dx2 = dx2 * dx2;
for( y = 0; y < 16; y++ )
{
dy = y - 8;
d = 255 - 35 * sqrt( dx2 + dy * dy );
data2D[( y*16 + x ) * 4 + 3] = bound( 0, d, 255 );
}
}
return &r_image;
}
/*
==================
R_InitSkyTexture
@ -2372,6 +2406,7 @@ static void R_InitBuiltinTextures( void )
{ "*white", &tr.whiteTexture, R_InitWhiteTexture },
{ "*gray", &tr.grayTexture, R_InitGrayTexture },
{ "*black", &tr.blackTexture, R_InitBlackTexture },
{ "*particle", &tr.particleTexture, R_InitParticleTexture },
{ "*cintexture", &tr.cinTexture, R_InitCinematicTexture }, // force linear filter
{ "*dlight", &tr.dlightTexture, R_InitDlightTexture },
{ "*dlight2", &tr.dlightTexture2, R_InitDlightTexture2 },

View File

@ -158,6 +158,7 @@ typedef struct
int whiteTexture;
int grayTexture;
int blackTexture;
int particleTexture;
int defaultTexture; // use for bad textures
int solidskyTexture; // quake1 solid-sky layer
int alphaskyTexture; // quake1 alpha-sky layer
@ -415,7 +416,6 @@ void GL_ResetFogColor( void );
void R_SpriteInit( void );
void Mod_LoadSpriteModel( model_t *mod, const void *buffer, qboolean *loaded, uint texFlags );
mspriteframe_t *R_GetSpriteFrame( const model_t *pModel, int frame, float yaw );
void R_SetSpriteRenderamt( cl_entity_t *ent, const model_t *pModel );
void R_SetSpriteRendermode( const model_t *pModel );
void R_DrawSpriteModel( cl_entity_t *e );

View File

@ -24,7 +24,7 @@ GNU General Public License for more details.
#include "cl_tent.h"
#include "studio.h"
#define PART_SIZE Q_max( 0.5f, (cl_draw_particles->value - 0.5f)) // because original particle of Quake1 was smaller than this
#define PART_SIZE Q_max( 0.5f, cl_draw_particles->value )
/*
==============================================================
@ -376,10 +376,9 @@ void CL_DrawParticles( double frametime )
if( !cl_active_particles )
return; // nothing to draw?
if( !TriSpriteTexture( cl_sprite_dot, 0 ))
return;
GL_SetRenderMode( kRenderTransTexture );
GL_Bind( GL_TEXTURE0, tr.particleTexture );
R_SetSpriteRendermode( cl_sprite_dot );
pglBegin( GL_QUADS );
for( p = cl_active_particles; p; p = p->next )
@ -408,7 +407,7 @@ void CL_DrawParticles( double frametime )
if( alpha > 255 || p->type == pt_static )
alpha = 255;
pglColor4ub( pColor->r, pColor->g, pColor->b, alpha );
pglColor4ub( LightToTexGamma( pColor->r ), LightToTexGamma( pColor->g ), LightToTexGamma( pColor->b ), alpha );
pglTexCoord2f( 0.0f, 1.0f );
pglVertex3f( p->org[0] - right[0] + up[0], p->org[1] - right[1] + up[1], p->org[2] - right[2] + up[2] );

View File

@ -2040,7 +2040,10 @@ Mark the leaves and nodes that are in the PVS for the current leaf
void R_MarkLeaves( void )
{
qboolean novis = false;
qboolean force = false;
mleaf_t *leaf = NULL;
mnode_t *node;
vec3_t test;
int i;
if( !RI.drawWorld ) return;
@ -2053,7 +2056,27 @@ void R_MarkLeaves( void )
RI.viewleaf = NULL;
}
if( RI.viewleaf == RI.oldviewleaf && RI.viewleaf != NULL )
VectorCopy( RI.pvsorigin, test );
if( RI.viewleaf != NULL )
{
// merge two leafs that can be a crossed-line contents
if( RI.viewleaf->contents == CONTENTS_EMPTY )
{
VectorSet( test, RI.pvsorigin[0], RI.pvsorigin[1], RI.pvsorigin[2] - 16.0f );
leaf = Mod_PointInLeaf( test, cl.worldmodel->nodes );
}
else
{
VectorSet( test, RI.pvsorigin[0], RI.pvsorigin[1], RI.pvsorigin[2] + 16.0f );
leaf = Mod_PointInLeaf( test, cl.worldmodel->nodes );
}
if(( leaf->contents != CONTENTS_SOLID ) && ( RI.viewleaf != leaf ))
force = true;
}
if( RI.viewleaf == RI.oldviewleaf && RI.viewleaf != NULL && !force )
return;
// development aid to let you run around
@ -2067,6 +2090,7 @@ void R_MarkLeaves( void )
novis = true;
Mod_FatPVS( RI.pvsorigin, REFPVS_RADIUS, RI.visbytes, world.visbytes, FBitSet( RI.params, RP_OLDVIEWLEAF ), novis );
if( force && !novis ) Mod_FatPVS( test, REFPVS_RADIUS, RI.visbytes, world.visbytes, true, novis );
for( i = 0; i < cl.worldmodel->numleafs; i++ )
{

View File

@ -513,25 +513,6 @@ void R_SetSpriteRendermode( const model_t *pModel )
}
}
/*
================
R_SetSpriteRenderamt
assume pModel is valid
================
*/
void R_SetSpriteRenderamt( cl_entity_t *ent, const model_t *pModel )
{
msprite_t *psprite;
if( !pModel ) return;
psprite = (msprite_t *)pModel->cache.data;
if( !psprite ) return;
if( psprite->texFormat == SPR_NORMAL || psprite->texFormat == SPR_ALPHTEST )
ent->curstate.renderamt = 255;
}
/*
================
R_GetSpriteFrame

View File

@ -1635,9 +1635,9 @@ void R_StudioDynamicLight( cl_entity_t *ent, alight_t *plight )
{
VectorSet( lightDir, mv->skyvec_x, mv->skyvec_y, mv->skyvec_z );
light.r = mv->skycolor_r;
light.g = mv->skycolor_g;
light.b = mv->skycolor_b;
light.r = LightToTexGamma( bound( 0, mv->skycolor_r, 255 ));
light.g = LightToTexGamma( bound( 0, mv->skycolor_g, 255 ));
light.b = LightToTexGamma( bound( 0, mv->skycolor_b, 255 ));
}
}
@ -2327,6 +2327,7 @@ static void R_StudioDrawPoints( void )
pglEnable( GL_ALPHA_TEST );
pglAlphaFunc( GL_GREATER, 0.5f );
pglDepthMask( GL_TRUE );
tr.blend = 1.0f;
}
else if( FBitSet( g_nFaceFlags, STUDIO_NF_ADDITIVE ) && R_ModelOpaque( RI.currententity->curstate.rendermode ))
{

View File

@ -1611,8 +1611,8 @@ void GL_InitCommands( void )
// make sure gl_vsync is checked after vid_restart
SetBits( gl_vsync->flags, FCVAR_CHANGED );
vid_gamma = Cvar_Get( "gamma", "1.0", FCVAR_ARCHIVE, "gamma amount" );
vid_brightness = Cvar_Get( "brightness", "1.0", FCVAR_ARCHIVE, "brighntess factor" );
vid_gamma = Cvar_Get( "gamma", "2.5", FCVAR_ARCHIVE, "gamma amount" );
vid_brightness = Cvar_Get( "brightness", "0.0", FCVAR_ARCHIVE, "brighntess factor" );
vid_mode = Cvar_Get( "vid_mode", VID_AUTOMODE, FCVAR_RENDERINFO|FCVAR_VIDRESTART, "display resolution mode" );
vid_fullscreen = Cvar_Get( "fullscreen", "0", FCVAR_RENDERINFO|FCVAR_VIDRESTART, "set in 1 to enable fullscreen mode" );
vid_displayfrequency = Cvar_Get ( "vid_displayfrequency", "0", FCVAR_RENDERINFO|FCVAR_VIDRESTART, "fullscreen refresh rate" );

View File

@ -331,7 +331,6 @@ typedef struct host_parm_s
qboolean mouse_visible; // vgui override cursor control
qboolean input_enabled; // vgui override mouse & keyboard input
qboolean shutdown_issued; // engine is shutting down
qboolean decal_loading; // nasty hack to tell imagelib about decal
qboolean overview_loading; // another nasty hack to tell imagelib about ovierview
qboolean force_draw_version; // used when fraps is loaded
qboolean write_to_clipboard; // put image to clipboard instead of disk

View File

@ -2075,7 +2075,7 @@ void Con_DrawConsole( void )
switch( cls.state )
{
case ca_disconnected:
if( cls.key_dest != key_menu && host.developer )
if( cls.key_dest != key_menu )
{
Con_DrawSolidConsole( glState.height );
Key_SetKeyDest( key_console );

View File

@ -79,12 +79,10 @@ void BuildGammaTable( float lightgamma, float brightness )
byte LightToTexGamma( byte b )
{
b = bound( 0, b, 255 );
return lightgammatable[b];
}
byte TextureToGamma( byte b )
{
b = bound( 0, b, 255 );
return texgammatable[b];
}

View File

@ -380,7 +380,7 @@ qboolean Image_LoadMIP( const char *name, const byte *buffer, size_t filesize )
// setup rendermode
if( Q_strrchr( name, '{' ))
{
if( !host.decal_loading )
if( pal[765] == 0 && pal[766] == 0 && pal[767] == 255 )
{
rendermode = LUMP_MASKED;
}
@ -486,7 +486,7 @@ qboolean Image_LoadMIP( const char *name, const byte *buffer, size_t filesize )
// grab the fog density
image.fogParams[3] = pal[4*3+0];
}
else if( hl_texture && host.decal_loading )
else if( hl_texture && ( rendermode == LUMP_GRADIENT ))
{
// grab the decal color
image.fogParams[0] = pal[255*3+0];

View File

@ -22,6 +22,7 @@ GNU General Public License for more details.
#define FMOVE_IGNORE_GLASS 0x100
#define FMOVE_SIMPLEBOX 0x200
#define FMOVE_MONSTERCLIP 0x400
#define CONTENTS_NONE 0 // no custom contents specified

33
engine/engine.plg Normal file
View File

@ -0,0 +1,33 @@
<html>
<body>
<pre>
<h1>Build Log</h1>
<h3>
--------------------Configuration: engine - Win32 Release--------------------
</h3>
<h3>Command Lines</h3>
Creating temporary file "C:\WINDOWS\TEMP\RSP2AD9.bat" with contents
[
@echo off
copy \Xash3D\src_main\temp\engine\!release\xash.dll "D:\Xash3D\xash.dll"
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\RSP2AD9.bat"
<h3>Output Window</h3>
Performing Custom Build Step on \Xash3D\src_main\temp\engine\!release\xash.dll
‘ª®¯¨à®¢ ­® ä ©«®¢: 1.
‘ª®¯¨à®¢ ­® ä ©«®¢: 1.
‘ª®¯¨à®¢ ­® ä ©«®¢: 1.
Žâª § ­® ¢ ¤®áâ㯥.
‘ª®¯¨à®¢ ­® ä ©«®¢: 0.
Error executing c:\windows\system32\cmd.exe.
<h3>Results</h3>
xash.dll - 1 error(s), 0 warning(s)
</pre>
</body>
</html>

View File

@ -629,8 +629,9 @@ void SV_UnlinkEdict( edict_t *ent );
void SV_ClipMoveToEntity( edict_t *ent, const vec3_t start, vec3_t mins, vec3_t maxs, const vec3_t end, trace_t *trace );
void SV_CustomClipMoveToEntity( edict_t *ent, const vec3_t start, vec3_t mins, vec3_t maxs, const vec3_t end, trace_t *trace );
trace_t SV_TraceHull( edict_t *ent, int hullNum, const vec3_t start, vec3_t mins, vec3_t maxs, const vec3_t end );
trace_t SV_Move( const vec3_t start, vec3_t mins, vec3_t maxs, const vec3_t end, int type, edict_t *e );
trace_t SV_Move( const vec3_t start, vec3_t mins, vec3_t maxs, const vec3_t end, int type, edict_t *e, qboolean monsterclip );
trace_t SV_MoveNoEnts( const vec3_t start, vec3_t mins, vec3_t maxs, const vec3_t end, int type, edict_t *e );
trace_t SV_MoveNormal( const vec3_t start, vec3_t mins, vec3_t maxs, const vec3_t end, int type, edict_t *e );
const char *SV_TraceTexture( edict_t *ent, const vec3_t start, const vec3_t end );
msurface_t *SV_TraceSurface( edict_t *ent, const vec3_t start, const vec3_t end );
trace_t SV_MoveToss( edict_t *tossent, edict_t *ignore );

View File

@ -1722,6 +1722,7 @@ int pfnDropToFloor( edict_t* e )
{
vec3_t end;
trace_t trace;
qboolean monsterClip;
if( !SV_IsValidEdict( e ))
{
@ -1729,10 +1730,11 @@ int pfnDropToFloor( edict_t* e )
return 0;
}
monsterClip = FBitSet( e->v.flags, FL_MONSTERCLIP ) ? true : false;
VectorCopy( e->v.origin, end );
end[2] -= 256;
trace = SV_Move( e->v.origin, e->v.mins, e->v.maxs, end, MOVE_NORMAL, e );
trace = SV_Move( e->v.origin, e->v.mins, e->v.maxs, end, MOVE_NORMAL, e, monsterClip );
if( trace.allsolid )
return -1;
@ -2083,7 +2085,7 @@ static void pfnTraceLine( const float *v1, const float *v2, int fNoMonsters, edi
if( !ptr ) return;
trace = SV_Move( v1, vec3_origin, vec3_origin, v2, fNoMonsters, pentToSkip );
trace = SV_Move( v1, vec3_origin, vec3_origin, v2, fNoMonsters, pentToSkip, false );
if( !SV_IsValidEdict( trace.ent )) trace.ent = svgame.edicts;
SV_ConvertTrace( ptr, &trace );
}
@ -2129,7 +2131,7 @@ static void pfnTraceHull( const float *v1, const float *v2, int fNoMonsters, int
mins = sv.worldmodel->hulls[hullNumber].clip_mins;
maxs = sv.worldmodel->hulls[hullNumber].clip_maxs;
trace = SV_Move( v1, mins, maxs, v2, fNoMonsters, pentToSkip );
trace = SV_Move( v1, mins, maxs, v2, fNoMonsters, pentToSkip, false );
SV_ConvertTrace( ptr, &trace );
}
@ -2142,6 +2144,7 @@ pfnTraceMonsterHull
static int pfnTraceMonsterHull( edict_t *pEdict, const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr )
{
trace_t trace;
qboolean monsterClip;
if( !SV_IsValidEdict( pEdict ))
{
@ -2149,10 +2152,8 @@ static int pfnTraceMonsterHull( edict_t *pEdict, const float *v1, const float *v
return 1;
}
if( pEdict != pentToSkip )
MsgDev( D_ERROR, "TRACE_MONSTER_HULL: pEdict != pentToSkip\n" );
trace = SV_Move( v1, pEdict->v.mins, pEdict->v.maxs, v2, fNoMonsters, pentToSkip );
monsterClip = FBitSet( pEdict->v.flags, FL_MONSTERCLIP ) ? true : false;
trace = SV_Move( v1, pEdict->v.mins, pEdict->v.maxs, v2, fNoMonsters, pentToSkip, monsterClip );
if( ptr ) SV_ConvertTrace( ptr, &trace );
if( trace.allsolid || trace.fraction != 1.0f )
@ -2267,9 +2268,9 @@ void pfnGetAimVector( edict_t* ent, float speed, float *rgflReturn )
// try sending a trace straight
VectorCopy( svgame.globals->v_forward, dir );
VectorMA( start, 2048, dir, end );
tr = SV_Move( start, vec3_origin, vec3_origin, end, MOVE_NORMAL, ent );
tr = SV_Move( start, vec3_origin, vec3_origin, end, MOVE_NORMAL, ent, false );
if( tr.ent && (tr.ent->v.takedamage == DAMAGE_AIM || ent->v.team <= 0 || ent->v.team != tr.ent->v.team ))
if( tr.ent && ( tr.ent->v.takedamage == DAMAGE_AIM || ent->v.team <= 0 || ent->v.team != tr.ent->v.team ))
return;
// try all possible entities
@ -2289,7 +2290,7 @@ void pfnGetAimVector( edict_t* ent, float speed, float *rgflReturn )
VectorNormalize( dir );
dist = DotProduct( dir, svgame.globals->v_forward );
if( dist < bestdist ) continue; // to far to turn
tr = SV_Move( start, vec3_origin, vec3_origin, end, MOVE_NORMAL, ent );
tr = SV_Move( start, vec3_origin, vec3_origin, end, MOVE_NORMAL, ent, false );
if( tr.ent == check )
{
bestdist = dist;

View File

@ -317,7 +317,7 @@ void SV_ActivateServer( void )
}
else if( svs.maxclients <= 1 )
{
sv.frametime = 0.1f;
sv.frametime = 0.8f; // EXPERIMENTAL!!!
numFrames = 2;
}
else
@ -730,6 +730,8 @@ qboolean SV_NewGame( const char *mapName, qboolean loadGame )
sv.background = false;
sv.changelevel = false;
SCR_BeginLoadingPlaque( false );
if( !SV_SpawnServer( mapName, NULL ))
return false;

View File

@ -35,9 +35,11 @@ qboolean SV_CheckBottom( edict_t *ent, int iMode )
{
vec3_t mins, maxs, start, stop;
float mid, bottom;
qboolean monsterClip;
trace_t trace;
int x, y;
monsterClip = FBitSet( ent->v.flags, FL_MONSTERCLIP ) ? true : false;
VectorAdd( ent->v.origin, ent->v.mins, mins );
VectorAdd( ent->v.origin, ent->v.maxs, maxs );
@ -73,7 +75,7 @@ realcheck:
if( iMode == WALKMOVE_WORLDONLY )
trace = SV_MoveNoEnts( start, vec3_origin, vec3_origin, stop, MOVE_NORMAL, ent );
else trace = SV_Move( start, vec3_origin, vec3_origin, stop, MOVE_NORMAL, ent );
else trace = SV_Move( start, vec3_origin, vec3_origin, stop, MOVE_NORMAL, ent, monsterClip );
if( trace.fraction == 1.0f )
return false;
@ -90,7 +92,7 @@ realcheck:
if( iMode == WALKMOVE_WORLDONLY )
trace = SV_MoveNoEnts( start, vec3_origin, vec3_origin, stop, MOVE_NORMAL, ent );
else trace = SV_Move( start, vec3_origin, vec3_origin, stop, MOVE_NORMAL, ent );
else trace = SV_Move( start, vec3_origin, vec3_origin, stop, MOVE_NORMAL, ent, monsterClip );
if( trace.fraction != 1.0f && trace.endpos[2] > bottom )
bottom = trace.endpos[2];
@ -252,11 +254,13 @@ qboolean SV_MoveStep( edict_t *ent, vec3_t move, qboolean relink )
int i;
trace_t trace;
vec3_t oldorg, neworg, end;
qboolean monsterClip;
edict_t *enemy;
float dz;
VectorCopy( ent->v.origin, oldorg );
VectorAdd( ent->v.origin, move, neworg );
monsterClip = FBitSet( ent->v.flags, FL_MONSTERCLIP ) ? true : false;
// well, try it. Flying and swimming monsters are easiest.
if( ent->v.flags & ( FL_SWIM|FL_FLY ))
@ -275,7 +279,7 @@ qboolean SV_MoveStep( edict_t *ent, vec3_t move, qboolean relink )
else if( dz < 30.0f ) neworg[2] += 8.0f;
}
trace = SV_Move( ent->v.origin, ent->v.mins, ent->v.maxs, neworg, MOVE_NORMAL, ent );
trace = SV_Move( ent->v.origin, ent->v.mins, ent->v.maxs, neworg, MOVE_NORMAL, ent, monsterClip );
if( trace.fraction == 1.0f )
{
@ -306,14 +310,14 @@ qboolean SV_MoveStep( edict_t *ent, vec3_t move, qboolean relink )
VectorCopy( neworg, end );
end[2] -= dz * 2.0f;
trace = SV_Move( neworg, ent->v.mins, ent->v.maxs, end, MOVE_NORMAL, ent );
trace = SV_Move( neworg, ent->v.mins, ent->v.maxs, end, MOVE_NORMAL, ent, monsterClip );
if( trace.allsolid )
return 0;
if( trace.startsolid != 0 )
{
neworg[2] -= dz;
trace = SV_Move( neworg, ent->v.mins, ent->v.maxs, end, MOVE_NORMAL, ent );
trace = SV_Move( neworg, ent->v.mins, ent->v.maxs, end, MOVE_NORMAL, ent, monsterClip );
if( trace.allsolid != 0 || trace.startsolid != 0 )
return 0;

View File

@ -567,9 +567,11 @@ int SV_FlyMove( edict_t *ent, float time, trace_t *steptrace )
vec3_t dir, end, planes[MAX_CLIP_PLANES];
vec3_t primal_velocity, original_velocity, new_velocity;
float d, time_left, allFraction;
qboolean monsterClip;
trace_t trace;
blocked = 0;
monsterClip = FBitSet( ent->v.flags, FL_MONSTERCLIP ) ? true : false;
VectorCopy( ent->v.velocity, original_velocity );
VectorCopy( ent->v.velocity, primal_velocity );
numplanes = 0;
@ -583,7 +585,7 @@ int SV_FlyMove( edict_t *ent, float time, trace_t *steptrace )
break;
VectorMA( ent->v.origin, time_left, ent->v.velocity, end );
trace = SV_Move( ent->v.origin, ent->v.mins, ent->v.maxs, end, MOVE_NORMAL, ent );
trace = SV_Move( ent->v.origin, ent->v.mins, ent->v.maxs, end, MOVE_NORMAL, ent, monsterClip );
allFraction += trace.fraction;
@ -781,9 +783,11 @@ 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 trace;
qboolean monsterClip;
int type;
vec3_t end;
monsterClip = FBitSet( ent->v.flags, FL_MONSTERCLIP ) ? true : false;
VectorAdd( ent->v.origin, lpush, end );
if( ent->v.movetype == MOVETYPE_FLYMISSILE )
@ -792,7 +796,7 @@ trace_t SV_PushEntity( edict_t *ent, const vec3_t lpush, const vec3_t apush, int
type = MOVE_NOMONSTERS; // only clip against bmodels
else type = MOVE_NORMAL;
trace = SV_Move( ent->v.origin, ent->v.mins, ent->v.maxs, end, type, ent );
trace = SV_Move( ent->v.origin, ent->v.mins, ent->v.maxs, end, type, ent, monsterClip );
if( trace.fraction != 0.0f )
{
@ -1642,7 +1646,7 @@ void SV_Physics_Step( edict_t *ent )
point[0] = x ? maxs[0] : mins[0];
point[1] = y ? maxs[1] : mins[1];
trace = SV_Move( point, vec3_origin, vec3_origin, point, MOVE_NORMAL, ent );
trace = SV_Move( point, vec3_origin, vec3_origin, point, MOVE_NORMAL, ent, false );
if( trace.startsolid )
{
@ -1660,7 +1664,8 @@ void SV_Physics_Step( edict_t *ent )
{
if( svgame.globals->force_retouch != 0 )
{
trace = SV_Move( ent->v.origin, ent->v.mins, ent->v.maxs, ent->v.origin, MOVE_NORMAL, ent );
qboolean monsterClip = FBitSet( ent->v.flags, FL_MONSTERCLIP ) ? true : false;
trace = SV_Move( ent->v.origin, ent->v.mins, ent->v.maxs, ent->v.origin, MOVE_NORMAL, ent, monsterClip );
// hentacle impact code
if(( trace.fraction < 1.0f || trace.startsolid ) && SV_IsValidEdict( trace.ent ))
@ -2011,7 +2016,7 @@ static server_physics_api_t gPhysicsAPI =
pfnMem_Alloc,
pfnMem_Free,
pfnPointContents,
SV_Move,
SV_MoveNormal,
SV_MoveNoEnts,
SV_BoxInPVS,
pfnWriteBytes,

View File

@ -474,7 +474,7 @@ void ReapplyDecal( SAVERESTOREDATA *pSaveData, decallist_t *entry, qboolean adja
VectorCopy( entry->position, testend );
VectorMA( testend, -5.0f, entry->impactPlaneNormal, testend );
tr = SV_Move( testspot, vec3_origin, vec3_origin, testend, MOVE_NOMONSTERS, NULL );
tr = SV_Move( testspot, vec3_origin, vec3_origin, testend, MOVE_NOMONSTERS, NULL, false );
// NOTE: this code may does wrong result on moving brushes e.g. func_tracktrain
if( tr.fraction != 1.0f && !tr.allsolid )

View File

@ -809,6 +809,7 @@ returns true if the entity is in solid currently
qboolean SV_TestEntityPosition( edict_t *ent, edict_t *blocker )
{
trace_t trace;
qboolean monsterClip = FBitSet( ent->v.flags, FL_MONSTERCLIP ) ? true : false;
if( ent->v.flags & (FL_CLIENT|FL_FAKECLIENT))
{
@ -818,7 +819,7 @@ qboolean SV_TestEntityPosition( edict_t *ent, edict_t *blocker )
else SV_SetMinMaxSize( ent, svgame.pmove->player_mins[0], svgame.pmove->player_maxs[0], true );
}
trace = SV_Move( ent->v.origin, ent->v.mins, ent->v.maxs, ent->v.origin, MOVE_NORMAL|FMOVE_SIMPLEBOX, ent );
trace = SV_Move( ent->v.origin, ent->v.mins, ent->v.maxs, ent->v.origin, MOVE_NORMAL|FMOVE_SIMPLEBOX, ent, monsterClip );
if( SV_IsValidEdict( blocker ) && SV_IsValidEdict( trace.ent ))
{
@ -1044,10 +1045,10 @@ static void SV_ClipToLinks( areanode_t *node, moveclip_t *clip )
// monsterclip filter (solid custom is a static or dynamic bodies)
if( touch->v.solid == SOLID_BSP || touch->v.solid == SOLID_CUSTOM )
{
if( touch->v.flags & FL_MONSTERCLIP )
if( FBitSet( touch->v.flags, FL_MONSTERCLIP ))
{
// func_monsterclip works only with monsters that have same flag!
if( !SV_IsValidEdict( clip->passedict ) || !( clip->passedict->v.flags & FL_MONSTERCLIP ))
if( !FBitSet( clip->flags, FMOVE_MONSTERCLIP ))
continue;
}
}
@ -1061,7 +1062,7 @@ static void SV_ClipToLinks( areanode_t *node, moveclip_t *clip )
if( Mod_GetType( touch->v.modelindex ) == mod_brush && clip->flags & FMOVE_IGNORE_GLASS )
{
// we ignore brushes with rendermode != kRenderNormal and without FL_WORLDBRUSH set
if( touch->v.rendermode != kRenderNormal && !( touch->v.flags & FL_WORLDBRUSH ))
if( touch->v.rendermode != kRenderNormal && !FBitSet( touch->v.flags, FL_WORLDBRUSH ))
continue;
}
@ -1162,7 +1163,7 @@ void SV_ClipToWorldBrush( areanode_t *node, moveclip_t *clip )
SV_Move
==================
*/
trace_t SV_Move( const vec3_t start, vec3_t mins, vec3_t maxs, const vec3_t end, int type, edict_t *e )
trace_t SV_Move( const vec3_t start, vec3_t mins, vec3_t maxs, const vec3_t end, int type, edict_t *e, qboolean monsterclip )
{
moveclip_t clip;
vec3_t trace_endpos;
@ -1184,6 +1185,9 @@ trace_t SV_Move( const vec3_t start, vec3_t mins, vec3_t maxs, const vec3_t end,
clip.mins = mins;
clip.maxs = maxs;
if( monsterclip )
SetBits( clip.flags, FMOVE_MONSTERCLIP );
if( clip.type == MOVE_MISSILE )
{
VectorSet( clip.mins2, -15.0f, -15.0f, -15.0f );
@ -1207,6 +1211,11 @@ trace_t SV_Move( const vec3_t start, vec3_t mins, vec3_t maxs, const vec3_t end,
return clip.trace;
}
trace_t SV_MoveNormal( const vec3_t start, vec3_t mins, vec3_t maxs, const vec3_t end, int type, edict_t *e )
{
return SV_Move( start, mins, maxs, end, type, e, false );
}
/*
==================
SV_MoveNoEnts
@ -1332,7 +1341,7 @@ trace_t SV_MoveToss( edict_t *tossent, edict_t *ignore )
VectorMA( tossent->v.angles, 0.05f, tossent->v.avelocity, tossent->v.angles );
VectorScale( tossent->v.velocity, 0.05f, move );
VectorAdd( tossent->v.origin, move, end );
trace = SV_Move( tossent->v.origin, tossent->v.mins, tossent->v.maxs, end, MOVE_NORMAL, tossent );
trace = SV_Move( tossent->v.origin, tossent->v.mins, tossent->v.maxs, end, MOVE_NORMAL, tossent, false );
VectorCopy( trace.endpos, tossent->v.origin );
if( trace.fraction < 1.0f ) break;
}

16
mainui/mainui.plg Normal file
View File

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