09 May 2014
This commit is contained in:
parent
10c465e98f
commit
515cd91097
|
@ -147,8 +147,8 @@ typedef struct sv_blending_interface_s
|
|||
const vec3_t origin,
|
||||
const byte *pcontroller,
|
||||
const byte *pblending,
|
||||
const edict_t *pEdict,
|
||||
int iBone ); // g-cont. right ordering here
|
||||
int iBone,
|
||||
const edict_t *pEdict );
|
||||
} sv_blending_interface_t;
|
||||
|
||||
#endif//R_STUDIOINT_H
|
|
@ -60,6 +60,7 @@ GNU General Public License for more details.
|
|||
#define PARM_FEATURES 26 // same as movevars->features
|
||||
#define PARM_ACTIVE_TMU 27 // for debug
|
||||
#define PARM_CACHEFRAME 28
|
||||
#define PARM_MAX_IMAGE_UNITS 29
|
||||
|
||||
enum
|
||||
{
|
||||
|
@ -211,7 +212,7 @@ typedef struct render_api_s
|
|||
|
||||
// Misc renderer functions
|
||||
void (*GL_DrawParticles)( const float *vieworg, const float *fwd, const float *rt, const float *up, unsigned int clipFlags );
|
||||
void (*EnvShot)( const float *vieworg, const char *name, qboolean skyshot ); // creates a cubemap or skybox into gfx\env folder
|
||||
void (*EnvShot)( const float *vieworg, const char *name, qboolean skyshot, int shotsize ); // creates a cubemap or skybox into gfx\env folder
|
||||
int (*COM_CompareFileTime)( const char *filename1, const char *filename2, int *iCompare );
|
||||
void (*Host_Error)( const char *error, ... ); // cause Host Error
|
||||
int (*SPR_LoadExt)( const char *szPicName, unsigned int texFlags ); // extended version of SPR_Load
|
||||
|
@ -249,7 +250,7 @@ typedef struct render_interface_s
|
|||
// replace with built-in R_DrawCubemapView for make skyshots or envshots
|
||||
qboolean (*R_DrawCubemapView)( const float *origin, const float *angles, int size );
|
||||
// alloc or destroy studiomodel custom data
|
||||
void (*Mod_ProcessUserData)( struct model_s *mod, qboolean create );
|
||||
void (*Mod_ProcessUserData)( struct model_s *mod, qboolean create, const byte *buffer );
|
||||
} render_interface_t;
|
||||
|
||||
#endif//RENDER_API_H
|
|
@ -226,6 +226,7 @@ void CL_ScreenShot_f( void )
|
|||
}
|
||||
|
||||
cls.envshot_vieworg = NULL; // no custom view
|
||||
cls.envshot_viewsize = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -266,6 +267,7 @@ void CL_SnapShot_f( void )
|
|||
}
|
||||
|
||||
cls.envshot_vieworg = NULL; // no custom view
|
||||
cls.envshot_viewsize = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -286,6 +288,7 @@ void CL_EnvShot_f( void )
|
|||
Q_sprintf( cls.shotname, "gfx/env/%s", Cmd_Argv( 1 ));
|
||||
cls.scrshot_action = scrshot_envshot; // build new frame for envshot
|
||||
cls.envshot_vieworg = NULL; // no custom view
|
||||
cls.envshot_viewsize = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -306,6 +309,7 @@ void CL_SkyShot_f( void )
|
|||
Q_sprintf( cls.shotname, "gfx/env/%s", Cmd_Argv( 1 ));
|
||||
cls.scrshot_action = scrshot_skyshot; // build new frame for skyshot
|
||||
cls.envshot_vieworg = NULL; // no custom view
|
||||
cls.envshot_viewsize = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -93,6 +93,11 @@ qboolean CL_IsPlaybackDemo( void )
|
|||
return cls.demoplayback;
|
||||
}
|
||||
|
||||
qboolean CL_DisableVisibility( void )
|
||||
{
|
||||
return cls.envshot_disable_vis;
|
||||
}
|
||||
|
||||
/*
|
||||
===============
|
||||
CL_ChangeGame
|
||||
|
@ -628,7 +633,7 @@ void CL_CheckForResend( void )
|
|||
if( cls.demoplayback || cls.state != ca_connecting )
|
||||
return;
|
||||
|
||||
if(( host.realtime - cls.connect_time ) < 3.0f )
|
||||
if(( host.realtime - cls.connect_time ) < 10.0f )
|
||||
return;
|
||||
|
||||
if( !NET_StringToAdr( cls.servername, &adr ))
|
||||
|
@ -868,6 +873,13 @@ void CL_LocalServers_f( void )
|
|||
{
|
||||
netadr_t adr;
|
||||
|
||||
// don't scan servers in singleplayer
|
||||
if( cls.state == ca_active && CL_GetMaxClients() == 1 )
|
||||
{
|
||||
MsgDev( D_INFO, "First disconnect from local game\n" );
|
||||
return;
|
||||
}
|
||||
|
||||
MsgDev( D_INFO, "Scanning for servers on the local network area...\n" );
|
||||
NET_Config( true ); // allow remote
|
||||
|
||||
|
@ -890,6 +902,13 @@ void CL_InternetServers_f( void )
|
|||
char part2query[128];
|
||||
string fullquery;
|
||||
|
||||
// don't scan servers in singleplayer
|
||||
if( cls.state == ca_active && CL_GetMaxClients() == 1 )
|
||||
{
|
||||
MsgDev( D_INFO, "First disconnect from local game\n" );
|
||||
return;
|
||||
}
|
||||
|
||||
MsgDev( D_INFO, "Scanning for servers on the internet area...\n" );
|
||||
NET_Config( true ); // allow remote
|
||||
|
||||
|
|
|
@ -210,6 +210,11 @@ void SCR_MakeLevelShot( void )
|
|||
void SCR_MakeScreenShot( void )
|
||||
{
|
||||
qboolean iRet = false;
|
||||
int viewsize;
|
||||
|
||||
if( cls.envshot_viewsize > 0 )
|
||||
viewsize = cls.envshot_viewsize;
|
||||
else viewsize = cl_envshot_size->integer;
|
||||
|
||||
switch( cls.scrshot_action )
|
||||
{
|
||||
|
@ -227,10 +232,10 @@ void SCR_MakeScreenShot( void )
|
|||
iRet = VID_ScreenShot( cls.shotname, VID_MINISHOT );
|
||||
break;
|
||||
case scrshot_envshot:
|
||||
iRet = VID_CubemapShot( cls.shotname, cl_envshot_size->integer, cls.envshot_vieworg, false );
|
||||
iRet = VID_CubemapShot( cls.shotname, viewsize, cls.envshot_vieworg, false );
|
||||
break;
|
||||
case scrshot_skyshot:
|
||||
iRet = VID_CubemapShot( cls.shotname, cl_envshot_size->integer, cls.envshot_vieworg, true );
|
||||
iRet = VID_CubemapShot( cls.shotname, viewsize, cls.envshot_vieworg, true );
|
||||
break;
|
||||
case scrshot_mapshot:
|
||||
iRet = VID_ScreenShot( cls.shotname, VID_MAPSHOT );
|
||||
|
@ -250,6 +255,8 @@ void SCR_MakeScreenShot( void )
|
|||
|
||||
cls.envshot_vieworg = NULL;
|
||||
cls.scrshot_action = scrshot_inactive;
|
||||
cls.envshot_disable_vis = false;
|
||||
cls.envshot_viewsize = 0;
|
||||
cls.shotname[0] = '\0';
|
||||
}
|
||||
|
||||
|
|
|
@ -432,6 +432,8 @@ typedef struct
|
|||
scrshot_t scrshot_request; // request for screen shot
|
||||
scrshot_t scrshot_action; // in-action
|
||||
const float *envshot_vieworg; // envshot position
|
||||
int envshot_viewsize; // override cvar
|
||||
qboolean envshot_disable_vis; // disable VIS on server while makes an envshots
|
||||
string shotname;
|
||||
|
||||
// download info
|
||||
|
|
|
@ -178,7 +178,9 @@ void GL_SelectTexture( GLint tmu )
|
|||
if( pglActiveTextureARB )
|
||||
{
|
||||
pglActiveTextureARB( tmu + GL_TEXTURE0_ARB );
|
||||
pglClientActiveTextureARB( tmu + GL_TEXTURE0_ARB );
|
||||
|
||||
if( tmu < glConfig.max_texture_coords )
|
||||
pglClientActiveTextureARB( tmu + GL_TEXTURE0_ARB );
|
||||
}
|
||||
else if( pglSelectTextureSGIS )
|
||||
{
|
||||
|
@ -272,7 +274,7 @@ GL_TexGen
|
|||
*/
|
||||
void GL_TexGen( GLenum coord, GLenum mode )
|
||||
{
|
||||
int tmu = glState.activeTMU;
|
||||
int tmu = min( glConfig.max_texture_coords, glState.activeTMU );
|
||||
int bit, gen;
|
||||
|
||||
switch( coord )
|
||||
|
@ -322,7 +324,7 @@ GL_SetTexCoordArrayMode
|
|||
*/
|
||||
void GL_SetTexCoordArrayMode( GLenum mode )
|
||||
{
|
||||
int tmu = glState.activeTMU;
|
||||
int tmu = min( glConfig.max_texture_coords, glState.activeTMU );
|
||||
int bit, cmode = glState.texCoordArrayMode[tmu];
|
||||
|
||||
if( mode == GL_TEXTURE_COORD_ARRAY )
|
||||
|
@ -588,7 +590,7 @@ qboolean VID_CubemapShot( const char *base, uint size, const float *vieworg, qbo
|
|||
flags = r_envMapInfo[i].flags;
|
||||
}
|
||||
|
||||
pglReadPixels( 0, glState.height - size, size, size, GL_RGB, GL_UNSIGNED_BYTE, temp );
|
||||
pglReadPixels( 0, 0, size, size, GL_RGB, GL_UNSIGNED_BYTE, temp );
|
||||
r_side->flags = IMAGE_HAS_COLOR;
|
||||
r_side->width = r_side->height = size;
|
||||
r_side->type = PF_RGB_24;
|
||||
|
|
|
@ -592,14 +592,46 @@ Build mirror chains for this frame
|
|||
*/
|
||||
void R_FindMirrors( const ref_params_t *fd )
|
||||
{
|
||||
vec3_t viewOrg, viewAng;
|
||||
|
||||
if( !world.has_mirrors || RI.drawOrtho || !RI.drawWorld || RI.refdef.onlyClientDraw || !cl.worldmodel )
|
||||
return;
|
||||
|
||||
RI.refdef = *fd;
|
||||
|
||||
// build the transformation matrix for the given view angles
|
||||
VectorCopy( RI.refdef.vieworg, RI.vieworg );
|
||||
AngleVectors( RI.refdef.viewangles, RI.vforward, RI.vright, RI.vup );
|
||||
if( cl.thirdperson )
|
||||
{
|
||||
vec3_t cam_ofs, vpn;
|
||||
|
||||
clgame.dllFuncs.CL_CameraOffset( cam_ofs );
|
||||
|
||||
viewAng[PITCH] = cam_ofs[PITCH];
|
||||
viewAng[YAW] = cam_ofs[YAW];
|
||||
viewAng[ROLL] = 0;
|
||||
|
||||
AngleVectors( viewAng, vpn, NULL, NULL );
|
||||
VectorMA( RI.refdef.vieworg, -cam_ofs[ROLL], vpn, viewOrg );
|
||||
}
|
||||
else
|
||||
{
|
||||
VectorCopy( RI.refdef.vieworg, viewOrg );
|
||||
VectorCopy( RI.refdef.viewangles, viewAng );
|
||||
}
|
||||
|
||||
// build the transformation matrix for the given view angles
|
||||
VectorCopy( viewOrg, RI.vieworg );
|
||||
AngleVectors( viewAng, RI.vforward, RI.vright, RI.vup );
|
||||
|
||||
VectorCopy( RI.vieworg, RI.pvsorigin );
|
||||
|
||||
if( !r_lockcull->integer )
|
||||
{
|
||||
VectorCopy( RI.vieworg, RI.cullorigin );
|
||||
VectorCopy( RI.vforward, RI.cull_vforward );
|
||||
VectorCopy( RI.vright, RI.cull_vright );
|
||||
VectorCopy( RI.vup, RI.cull_vup );
|
||||
}
|
||||
|
||||
R_FindViewLeaf();
|
||||
R_SetupFrustum();
|
||||
|
|
|
@ -811,8 +811,11 @@ static void R_SetupFrame( void )
|
|||
// setup viewplane dist
|
||||
RI.viewplanedist = DotProduct( RI.vieworg, RI.vforward );
|
||||
|
||||
VectorCopy( RI.vieworg, RI.pvsorigin );
|
||||
|
||||
if( !r_lockcull->integer )
|
||||
{
|
||||
VectorCopy( RI.vieworg, RI.cullorigin );
|
||||
VectorCopy( RI.vforward, RI.cull_vforward );
|
||||
VectorCopy( RI.vright, RI.cull_vright );
|
||||
VectorCopy( RI.vup, RI.cull_vup );
|
||||
|
@ -1307,13 +1310,13 @@ void R_RenderFrame( const ref_params_t *fd, qboolean drawWorld )
|
|||
|
||||
// setup scissor
|
||||
RI.scissor[0] = fd->viewport[0];
|
||||
RI.scissor[1] = glState.height - fd->viewport[3] - fd->viewport[1];
|
||||
RI.scissor[1] = fd->viewport[1];
|
||||
RI.scissor[2] = fd->viewport[2];
|
||||
RI.scissor[3] = fd->viewport[3];
|
||||
|
||||
// setup viewport
|
||||
RI.viewport[0] = fd->viewport[0];
|
||||
RI.viewport[1] = glState.height - fd->viewport[3] - fd->viewport[1];
|
||||
RI.viewport[1] = fd->viewport[1];
|
||||
RI.viewport[2] = fd->viewport[2];
|
||||
RI.viewport[3] = fd->viewport[3];
|
||||
|
||||
|
@ -1364,7 +1367,8 @@ void R_DrawCubemapView( const vec3_t origin, const vec3_t angles, int size )
|
|||
fd = &RI.refdef;
|
||||
*fd = r_lastRefdef;
|
||||
fd->time = 0;
|
||||
fd->viewport[0] = RI.refdef.viewport[1] = 0;
|
||||
fd->viewport[0] = 0;
|
||||
fd->viewport[1] = 0;
|
||||
fd->viewport[2] = size;
|
||||
fd->viewport[3] = size;
|
||||
fd->fov_x = 90;
|
||||
|
@ -1375,13 +1379,13 @@ void R_DrawCubemapView( const vec3_t origin, const vec3_t angles, int size )
|
|||
|
||||
// setup scissor
|
||||
RI.scissor[0] = fd->viewport[0];
|
||||
RI.scissor[1] = glState.height - fd->viewport[3] - fd->viewport[1];
|
||||
RI.scissor[1] = fd->viewport[1];
|
||||
RI.scissor[2] = fd->viewport[2];
|
||||
RI.scissor[3] = fd->viewport[3];
|
||||
|
||||
// setup viewport
|
||||
RI.viewport[0] = fd->viewport[0];
|
||||
RI.viewport[1] = glState.height - fd->viewport[3] - fd->viewport[1];
|
||||
RI.viewport[1] = fd->viewport[1];
|
||||
RI.viewport[2] = fd->viewport[2];
|
||||
RI.viewport[3] = fd->viewport[3];
|
||||
|
||||
|
@ -1459,6 +1463,8 @@ static int GL_RenderGetParm( int parm, int arg )
|
|||
return glt->texType;
|
||||
case PARM_CACHEFRAME:
|
||||
return world.load_sequence;
|
||||
case PARM_MAX_IMAGE_UNITS:
|
||||
return GL_MaxTextureUnits();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -1494,7 +1500,7 @@ R_EnvShot
|
|||
|
||||
=================
|
||||
*/
|
||||
static void R_EnvShot( const float *vieworg, const char *name, int skyshot )
|
||||
static void R_EnvShot( const float *vieworg, const char *name, int skyshot, int shotsize )
|
||||
{
|
||||
static vec3_t viewPoint;
|
||||
|
||||
|
@ -1519,11 +1525,15 @@ static void R_EnvShot( const float *vieworg, const char *name, int skyshot )
|
|||
// make sure what viewpoint don't temporare
|
||||
VectorCopy( vieworg, viewPoint );
|
||||
cls.envshot_vieworg = viewPoint;
|
||||
cls.envshot_disable_vis = true;
|
||||
}
|
||||
|
||||
// make request for envshot
|
||||
if( skyshot ) cls.scrshot_action = scrshot_skyshot;
|
||||
else cls.scrshot_action = scrshot_envshot;
|
||||
|
||||
// catch negative values
|
||||
cls.envshot_viewsize = max( 0, shotsize );
|
||||
}
|
||||
|
||||
static void R_SetCurrentEntity( cl_entity_t *ent )
|
||||
|
|
|
@ -27,11 +27,11 @@ float V_CalcFov( float *fov_x, float width, float height )
|
|||
{
|
||||
float x, half_fov_y;
|
||||
|
||||
if( *fov_x < 1 || *fov_x > 170 )
|
||||
if( *fov_x < 1.0f || *fov_x > 170.0f )
|
||||
{
|
||||
if( !cls.demoplayback )
|
||||
MsgDev( D_ERROR, "V_CalcFov: bad fov %g!\n", *fov_x );
|
||||
*fov_x = 90;
|
||||
*fov_x = 90.0f;
|
||||
}
|
||||
|
||||
x = width / tan( DEG2RAD( *fov_x ) * 0.5f );
|
||||
|
|
|
@ -535,8 +535,8 @@ void CL_DrawParticles( void )
|
|||
if( !cl_draw_particles->integer )
|
||||
return;
|
||||
|
||||
// HACKHACK: don't evaluate particles when executes many times at same frame
|
||||
// e.g. mirror rendering
|
||||
// don't evaluate particles when executes many times
|
||||
// at same frame e.g. mirror rendering
|
||||
if( framecount != tr.realframecount )
|
||||
{
|
||||
frametime = cl.time - cl.oldtime;
|
||||
|
|
|
@ -652,7 +652,7 @@ Combine and scale multiple lightmaps into the floating
|
|||
format in r_blocklights
|
||||
=================
|
||||
*/
|
||||
static void R_BuildLightMap( msurface_t *surf, byte *dest, int stride )
|
||||
static void R_BuildLightMap( msurface_t *surf, byte *dest, int stride, qboolean dynamic )
|
||||
{
|
||||
int smax, tmax;
|
||||
uint *bl, scale;
|
||||
|
@ -681,7 +681,7 @@ static void R_BuildLightMap( msurface_t *surf, byte *dest, int stride )
|
|||
}
|
||||
|
||||
// add all the dynamic lights
|
||||
if( surf->dlightframe == tr.framecount )
|
||||
if( surf->dlightframe == tr.framecount && dynamic )
|
||||
R_AddDynamicLights( surf );
|
||||
|
||||
// Put into texture format
|
||||
|
@ -890,7 +890,7 @@ void R_BlendLightmaps( void )
|
|||
base = gl_lms.lightmap_buffer;
|
||||
base += ( info->dlight_t * BLOCK_SIZE + info->dlight_s ) * 4;
|
||||
|
||||
R_BuildLightMap( surf, base, BLOCK_SIZE * 4 );
|
||||
R_BuildLightMap( surf, base, BLOCK_SIZE * 4, true );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -926,7 +926,7 @@ void R_BlendLightmaps( void )
|
|||
base = gl_lms.lightmap_buffer;
|
||||
base += ( info->dlight_t * BLOCK_SIZE + info->dlight_s ) * 4;
|
||||
|
||||
R_BuildLightMap( surf, base, BLOCK_SIZE * 4 );
|
||||
R_BuildLightMap( surf, base, BLOCK_SIZE * 4, true );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1204,7 +1204,7 @@ dynamic:
|
|||
smax = ( fa->extents[0] / LM_SAMPLE_SIZE ) + 1;
|
||||
tmax = ( fa->extents[1] / LM_SAMPLE_SIZE ) + 1;
|
||||
|
||||
R_BuildLightMap( fa, temp, smax * 4 );
|
||||
R_BuildLightMap( fa, temp, smax * 4, true );
|
||||
R_SetCacheState( fa );
|
||||
|
||||
GL_Bind( GL_TEXTURE0, tr.lightmapTextures[fa->lightmaptexturenum] );
|
||||
|
@ -2039,7 +2039,7 @@ void GL_CreateSurfaceLightmap( msurface_t *surf )
|
|||
base += ( surf->light_t * BLOCK_SIZE + surf->light_s ) * 4;
|
||||
|
||||
R_SetCacheState( surf );
|
||||
R_BuildLightMap( surf, base, BLOCK_SIZE * 4 );
|
||||
R_BuildLightMap( surf, base, BLOCK_SIZE * 4, false );
|
||||
|
||||
// moved here in case we need valid lightmap coords
|
||||
if( host.features & ENGINE_BUILD_SURFMESHES )
|
||||
|
|
|
@ -2123,7 +2123,7 @@ static void R_StudioDrawPoints( void )
|
|||
}
|
||||
else if( g_nFaceFlags & STUDIO_NF_FULLBRIGHT )
|
||||
{
|
||||
pglColor4f( 1.0f, 1.0f, 1.0f, 1.0f );
|
||||
pglColor4f( 1.0f, 1.0f, 1.0f, alpha );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -3591,7 +3591,7 @@ void Mod_LoadStudioModel( model_t *mod, const void *buffer, qboolean *loaded )
|
|||
mstudioseqdesc_t *pseqdesc = (mstudioseqdesc_t *)((byte *)phdr + phdr->seqindex);
|
||||
|
||||
// HACKHACK: MilkShape created a default animations with 30 frames
|
||||
// FIXME: analyze real frames for more predicatable results
|
||||
// TODO: analyze real frames for more predicatable results
|
||||
// TODO: analyze all the sequences
|
||||
if( pseqdesc->numframes == 1 || pseqdesc->numframes == 30 )
|
||||
pseqdesc->flags |= STUDIO_STATIC;
|
||||
|
|
|
@ -495,7 +495,7 @@ GL_MaxTextureUnits
|
|||
int GL_MaxTextureUnits( void )
|
||||
{
|
||||
if( GL_Support( GL_SHADER_GLSL100_EXT ))
|
||||
return max( min( glConfig.max_texture_coords, glConfig.max_teximage_units ), MAX_TEXTURE_UNITS );
|
||||
return min( max( glConfig.max_texture_coords, glConfig.max_teximage_units ), MAX_TEXTURE_UNITS );
|
||||
return glConfig.max_texture_units;
|
||||
}
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ static char mond[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
|
|||
int Q_buildnum( void )
|
||||
{
|
||||
// do not touch this! Only author of Xash3D can increase buildnumbers!
|
||||
#if 1
|
||||
#if 0
|
||||
int m = 0, d = 0, y = 0;
|
||||
static int b = 0;
|
||||
|
||||
|
@ -48,6 +48,6 @@ int Q_buildnum( void )
|
|||
|
||||
return b;
|
||||
#else
|
||||
return 2467;
|
||||
return 2636;
|
||||
#endif
|
||||
}
|
|
@ -766,6 +766,7 @@ qboolean CL_IsIntermission( void );
|
|||
float CL_GetServerTime( void );
|
||||
float CL_GetLerpFrac( void );
|
||||
void CL_CharEvent( int key );
|
||||
qboolean CL_DisableVisibility( void );
|
||||
int CL_PointContents( const vec3_t point );
|
||||
char *COM_ParseFile( char *data, char *token );
|
||||
byte *COM_LoadFile( const char *filename, int usehunk, int *pLength );
|
||||
|
|
|
@ -2703,7 +2703,7 @@ qboolean FS_Delete( const char *path )
|
|||
COM_FixSlashes( real_path );
|
||||
iRet = remove( real_path );
|
||||
|
||||
return (iRet == 0);
|
||||
return (iRet == 0) ? true : false;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -26,6 +26,7 @@ GNU General Public License for more details.
|
|||
#define DIST_EPSILON (1.0f / 32.0f)
|
||||
#define FRAC_EPSILON (1.0f / 1024.0f)
|
||||
#define BACKFACE_EPSILON 0.01f
|
||||
#define DEFAULT_SMOOTHING_ANGLE 50.0f
|
||||
#define MAX_BOX_LEAFS 256
|
||||
#define DVIS_PVS 0
|
||||
#define DVIS_PHS 1
|
||||
|
@ -83,6 +84,7 @@ typedef struct
|
|||
int lm_sample_size; // defaulting to 16 (BSP31 uses 8)
|
||||
int block_size; // lightmap blocksize
|
||||
color24 *deluxedata; // deluxemap data pointer
|
||||
float smooth_threshold; // used for calc smoothed TBN
|
||||
|
||||
vec3_t mins; // real accuracy world bounds
|
||||
vec3_t maxs;
|
||||
|
|
|
@ -233,7 +233,7 @@ hull_t *Mod_HullForStudio( model_t *model, float frame, int sequence, vec3_t ang
|
|||
if( !( host.features & ENGINE_COMPENSATE_QUAKE_BUG ))
|
||||
angles2[PITCH] = -angles2[PITCH]; // stupid quake bug
|
||||
|
||||
pBlendAPI->SV_StudioSetupBones( model, frame, sequence, angles2, origin, pcontroller, pblending, pEdict, -1 );
|
||||
pBlendAPI->SV_StudioSetupBones( model, frame, sequence, angles2, origin, pcontroller, pblending, -1, pEdict );
|
||||
phitbox = (mstudiobbox_t *)((byte *)mod_studiohdr + mod_studiohdr->hitboxindex);
|
||||
|
||||
for( i = j = 0; i < mod_studiohdr->numhitboxes; i++, j += 6 )
|
||||
|
@ -633,7 +633,7 @@ NOTE: pEdict is unused
|
|||
====================
|
||||
*/
|
||||
static void SV_StudioSetupBones( model_t *pModel, float frame, int sequence, const vec3_t angles, const vec3_t origin,
|
||||
const byte *pcontroller, const byte *pblending, const edict_t *pEdict, int iBone )
|
||||
const byte *pcontroller, const byte *pblending, int iBone, const edict_t *pEdict )
|
||||
{
|
||||
int i, j, numbones = 0;
|
||||
int boneused[MAXSTUDIOBONES];
|
||||
|
@ -760,7 +760,7 @@ void Mod_StudioGetAttachment( const edict_t *e, int iAttachment, float *origin,
|
|||
angles2[PITCH] = -angles2[PITCH];
|
||||
|
||||
pBlendAPI->SV_StudioSetupBones( mod, e->v.frame, e->v.sequence, angles2, e->v.origin,
|
||||
e->v.controller, e->v.blending, e, pAtt[iAttachment].bone );
|
||||
e->v.controller, e->v.blending, pAtt[iAttachment].bone, e );
|
||||
|
||||
// compute pos and angles
|
||||
if( origin != NULL )
|
||||
|
@ -793,7 +793,7 @@ void Mod_GetBonePosition( const edict_t *e, int iBone, float *origin, float *ang
|
|||
ASSERT( pBlendAPI != NULL );
|
||||
|
||||
pBlendAPI->SV_StudioSetupBones( mod, e->v.frame, e->v.sequence, e->v.angles, e->v.origin,
|
||||
e->v.controller, e->v.blending, e, iBone );
|
||||
e->v.controller, e->v.blending, iBone, e );
|
||||
|
||||
if( origin ) Matrix3x4_OriginFromMatrix( studio_bones[iBone], origin );
|
||||
if( angles ) VectorAngles( studio_bones[iBone][0], angles ); // bone forward to angles
|
||||
|
|
|
@ -490,7 +490,7 @@ static void Mod_FreeUserData( model_t *mod )
|
|||
if( clgame.drawFuncs.Mod_ProcessUserData != NULL )
|
||||
{
|
||||
// let the client.dll free custom data
|
||||
clgame.drawFuncs.Mod_ProcessUserData( mod, false );
|
||||
clgame.drawFuncs.Mod_ProcessUserData( mod, false, NULL );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1302,6 +1302,91 @@ static void Mod_CalcSurfaceBounds( msurface_t *surf, mextrasurf_t *info )
|
|||
VectorAverage( info->mins, info->maxs, info->origin );
|
||||
}
|
||||
|
||||
// this is a great time-waster. move to hlrad
|
||||
static void Mod_ComputeSmoothTBN( const msurface_t *f1, const int num, vec3_t t, vec3_t b, vec3_t n )
|
||||
{
|
||||
vec3_t n1, n2; // plane normals
|
||||
int i, j, e, vert;
|
||||
|
||||
if( f1->flags & SURF_PLANEBACK )
|
||||
VectorNegate( f1->plane->normal, n1 );
|
||||
else VectorCopy( f1->plane->normal, n1 );
|
||||
|
||||
e = loadmodel->surfedges[f1->firstedge + num];
|
||||
if( e > 0 ) vert = loadmodel->edges[e].v[0];
|
||||
else vert = loadmodel->edges[-e].v[1];
|
||||
|
||||
VectorClear( t );
|
||||
VectorClear( b );
|
||||
VectorClear( n );
|
||||
|
||||
for( i = 0; i < loadmodel->numsurfaces; i++ )
|
||||
{
|
||||
// check if this face contains vert
|
||||
msurface_t *f2 = &loadmodel->surfaces[i];
|
||||
qboolean hasVert = false;
|
||||
|
||||
for( j = 0; j < f2->numedges; j++ )
|
||||
{
|
||||
e = loadmodel->surfedges[f2->firstedge + j];
|
||||
|
||||
if( e > 0 && loadmodel->edges[e].v[0] == vert )
|
||||
{
|
||||
hasVert = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if( e < 0 && loadmodel->edges[-e].v[1] == vert )
|
||||
{
|
||||
hasVert = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if( !hasVert ) continue;
|
||||
|
||||
if( f2->flags & SURF_PLANEBACK )
|
||||
VectorNegate( f2->plane->normal, n2 );
|
||||
else VectorCopy( f2->plane->normal, n2 );
|
||||
|
||||
if( DotProduct( n1, n2 ) < world.smooth_threshold )
|
||||
continue;
|
||||
|
||||
VectorAdd( t, f2->texinfo->vecs[0], t );
|
||||
VectorNormalize( t );
|
||||
|
||||
VectorAdd( b, f2->texinfo->vecs[1], b );
|
||||
VectorNormalize( b );
|
||||
|
||||
VectorAdd( n, n2, n );
|
||||
VectorNormalize( n );
|
||||
}
|
||||
|
||||
if( VectorIsNull( t ))
|
||||
{
|
||||
VectorCopy( f1->texinfo->vecs[0], t );
|
||||
VectorNormalize( t );
|
||||
}
|
||||
|
||||
if( VectorIsNull( b ))
|
||||
{
|
||||
VectorCopy( f1->texinfo->vecs[1], b );
|
||||
VectorNormalize( b );
|
||||
}
|
||||
|
||||
if( VectorIsNull( n ))
|
||||
{
|
||||
VectorCopy( n1, n );
|
||||
}
|
||||
|
||||
// FIXME: get rid of this stupid binormal inversion!
|
||||
// 1. cleanup VHLT code
|
||||
// 2. cleanum Engine code
|
||||
// 3. cleanup Paranoia2 renderer
|
||||
// 4. cleanup XashXT renderer
|
||||
VectorNegate( b, b );
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
Mod_BuildPolygon
|
||||
|
@ -2200,6 +2285,9 @@ static void Mod_LoadEntities( const dlump_t *l )
|
|||
Q_memcpy( loadmodel->entities, mod_base + l->fileofs, l->filelen );
|
||||
if( !world.loading ) return;
|
||||
|
||||
// sets ZHLT\VHLT default value
|
||||
world.smooth_threshold = (float)cos( DEG2RAD( DEFAULT_SMOOTHING_ANGLE ));
|
||||
|
||||
world.entdatasize = l->filelen;
|
||||
pfile = (char *)loadmodel->entities;
|
||||
wadlist.count = 0;
|
||||
|
@ -2244,6 +2332,8 @@ static void Mod_LoadEntities( const dlump_t *l )
|
|||
}
|
||||
else if( !Q_stricmp( keyname, "mapversion" ))
|
||||
world.mapversion = Q_atoi( token );
|
||||
else if( !Q_stricmp( keyname, "smoothangle" ))
|
||||
world.smooth_threshold = (float)cos( DEG2RAD( Q_atof( token )));
|
||||
}
|
||||
return; // all done
|
||||
}
|
||||
|
@ -2936,22 +3026,24 @@ model_t *Mod_LoadModel( model_t *mod, qboolean crash )
|
|||
return NULL;
|
||||
}
|
||||
|
||||
Mem_Free( buf );
|
||||
|
||||
if( !loaded )
|
||||
{
|
||||
Mod_FreeModel( mod );
|
||||
Mem_Free( buf );
|
||||
|
||||
if( crash ) Host_Error( "Mod_ForName: %s couldn't load\n", tempname );
|
||||
else MsgDev( D_ERROR, "Mod_ForName: %s couldn't load\n", tempname );
|
||||
|
||||
return NULL;
|
||||
}
|
||||
else if( clgame.drawFuncs.Mod_ProcessUserData != NULL )
|
||||
{
|
||||
// let the client.dll load custom data
|
||||
clgame.drawFuncs.Mod_ProcessUserData( mod, true );
|
||||
clgame.drawFuncs.Mod_ProcessUserData( mod, true, buf );
|
||||
}
|
||||
|
||||
Mem_Free( buf );
|
||||
|
||||
return mod;
|
||||
}
|
||||
|
||||
|
|
|
@ -232,7 +232,7 @@ long Stream_ReadMPG( stream_t *stream, long needBytes, void *buffer )
|
|||
{
|
||||
int numReads = 0;
|
||||
|
||||
// HACKHACK: flush all the previous data
|
||||
// flush all the previous data
|
||||
while( read_mpeg_stream( mpg, NULL, 0 ) == MP3_OK && numReads++ < 255 );
|
||||
read_len = FS_Read( stream->file, tempbuff, sizeof( tempbuff ));
|
||||
result = read_mpeg_stream( mpg, tempbuff, read_len );
|
||||
|
|
|
@ -43,7 +43,7 @@ RSC=rc.exe
|
|||
# PROP Ignore_Export_Lib 1
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "./" /I "common" /I "common/imagelib" /I "common/soundlib" /I "server" /I "client" /I "client/vgui" /I "../common" /I "../game_shared" /I "../pm_shared" /I "../utils/vgui/include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "./" /I "common" /I "common/imagelib" /I "common/soundlib" /I "server" /I "client" /I "client/vgui" /I "../common" /I "../game_shared" /I "../pm_shared" /I "../utils/vgui/include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c
|
||||
# SUBTRACT CPP /Fr /YX
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
|
|
|
@ -1529,16 +1529,7 @@ edict_t* pfnFindClientInPVS( edict_t *pEdict )
|
|||
|
||||
mod = Mod_Handle( pEdict->v.modelindex );
|
||||
|
||||
if( mod && mod->type == mod_brush && !( mod->flags & MODEL_HAS_ORIGIN ))
|
||||
{
|
||||
// handle PVS origin for bmodels
|
||||
VectorAverage( pEdict->v.mins, pEdict->v.maxs, view );
|
||||
VectorAdd( view, pEdict->v.origin, view );
|
||||
}
|
||||
else
|
||||
{
|
||||
VectorAdd( pEdict->v.origin, pEdict->v.view_ofs, view );
|
||||
}
|
||||
VectorAdd( pEdict->v.origin, pEdict->v.view_ofs, view );
|
||||
|
||||
if( pEdict->v.effects & EF_INVLIGHT )
|
||||
view[2] -= 1.0f; // HACKHACK for barnacle
|
||||
|
@ -3856,7 +3847,7 @@ so we can't use a single PVS point
|
|||
*/
|
||||
byte *pfnSetFatPVS( const float *org )
|
||||
{
|
||||
if( !sv.worldmodel->visdata || sv_novis->integer || !org )
|
||||
if( !sv.worldmodel->visdata || sv_novis->integer || !org || CL_DisableVisibility( ))
|
||||
return Mod_DecompressVis( NULL );
|
||||
|
||||
ASSERT( svs.currentPlayerNum >= 0 && svs.currentPlayerNum < MAX_CLIENTS );
|
||||
|
@ -3887,7 +3878,7 @@ so we can't use a single PHS point
|
|||
*/
|
||||
byte *pfnSetFatPAS( const float *org )
|
||||
{
|
||||
if( !sv.worldmodel->visdata || sv_novis->integer || !org )
|
||||
if( !sv.worldmodel->visdata || sv_novis->integer || !org || CL_DisableVisibility( ))
|
||||
return Mod_DecompressVis( NULL );
|
||||
|
||||
ASSERT( svs.currentPlayerNum >= 0 && svs.currentPlayerNum < MAX_CLIENTS );
|
||||
|
|
|
@ -654,6 +654,7 @@ void SV_Init( void )
|
|||
Cvar_Get( "sv_alltalk", "1", 0, "allow to talking for all players (legacy, unused)" );
|
||||
Cvar_Get( "sv_airmove", "1", CVAR_SERVERNOTIFY, "enable airmovement (legacy, unused)" );
|
||||
Cvar_Get( "mp_autocrosshair", "0", 0, "allow auto crosshair in multiplayer (legacy, unused)" );
|
||||
Cvar_Get( "sv_allow_PhysX", "1", CVAR_ARCHIVE, "allow XashXT to usage PhysX engine" );
|
||||
|
||||
// half-life shared variables
|
||||
sv_zmax = Cvar_Get ("sv_zmax", "4096", CVAR_PHYSICINFO, "zfar server value" );
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -518,7 +518,9 @@ static void UI_PlayerSetup_Init( void )
|
|||
uiPlayerSetup.ent->latched.prevcontroller[1] = 127;
|
||||
uiPlayerSetup.ent->latched.prevcontroller[2] = 127;
|
||||
uiPlayerSetup.ent->latched.prevcontroller[3] = 127;
|
||||
uiPlayerSetup.ent->origin[0] = uiPlayerSetup.ent->curstate.origin[0] = 92;
|
||||
if(( ScreenWidth * 3 ) == ( 4 * ScreenHeight ) || ( ScreenWidth * 4 ) == ( ScreenHeight * 5 ))
|
||||
uiPlayerSetup.ent->origin[0] = uiPlayerSetup.ent->curstate.origin[0] = 92;
|
||||
else uiPlayerSetup.ent->origin[0] = uiPlayerSetup.ent->curstate.origin[0] = 120;
|
||||
uiPlayerSetup.ent->origin[2] = uiPlayerSetup.ent->curstate.origin[2] = 2;
|
||||
uiPlayerSetup.ent->angles[1] = uiPlayerSetup.ent->curstate.angles[1] = 180;
|
||||
uiPlayerSetup.ent->player = true; // yes, draw me as playermodel
|
||||
|
|
Reference in New Issue