18 Apr 2018
This commit is contained in:
parent
11b2d7e842
commit
72fe999567
|
@ -570,6 +570,8 @@ typedef struct
|
|||
GLint max_vertex_uniforms;
|
||||
GLint max_vertex_attribs;
|
||||
|
||||
GLint max_multisamples;
|
||||
|
||||
int color_bits;
|
||||
int alpha_bits;
|
||||
int depth_bits;
|
||||
|
|
|
@ -1625,7 +1625,7 @@ void R_StudioDynamicLight( cl_entity_t *ent, alight_t *plight )
|
|||
uint lnum;
|
||||
dlight_t *dl;
|
||||
|
||||
if( !plight || !ent )
|
||||
if( !plight || !ent || !ent->model )
|
||||
return;
|
||||
|
||||
if( !RI.drawWorld || r_fullbright->value || FBitSet( ent->curstate.effects, EF_FULLBRIGHT ))
|
||||
|
@ -1643,16 +1643,7 @@ void R_StudioDynamicLight( cl_entity_t *ent, alight_t *plight )
|
|||
VectorSet( lightDir, 0.0f, 0.0f, 1.0f );
|
||||
else VectorSet( lightDir, 0.0f, 0.0f, -1.0f );
|
||||
|
||||
if( ent == RI.currententity )
|
||||
{
|
||||
int sequence = bound( 0, ent->curstate.sequence, m_pStudioHeader->numseq - 1 );
|
||||
mstudioseqdesc_t *pseqdesc = (mstudioseqdesc_t *)((byte *)m_pStudioHeader + m_pStudioHeader->seqindex) + sequence;
|
||||
|
||||
if( FBitSet( pseqdesc->flags, STUDIO_LIGHT_FROM_ROOT ))
|
||||
Matrix3x4_OriginFromMatrix( g_studio.lighttransform[0], origin );
|
||||
else VectorCopy( ent->origin, origin );
|
||||
}
|
||||
else VectorCopy( ent->origin, origin );
|
||||
VectorCopy( ent->origin, origin );
|
||||
|
||||
VectorSet( vecSrc, origin[0], origin[1], origin[2] - lightDir[2] * 8.0f );
|
||||
light.r = light.g = light.b = light.a = 0;
|
||||
|
|
|
@ -675,7 +675,6 @@ static int VID_ChoosePFD( PIXELFORMATDESCRIPTOR *pfd, int colorBits, int alphaBi
|
|||
UINT numPixelFormats;
|
||||
int pixelFormat = 0;
|
||||
int attribs[24];
|
||||
int samples = 0;
|
||||
|
||||
attribs[0] = WGL_ACCELERATION_ARB;
|
||||
attribs[1] = WGL_FULL_ACCELERATION_ARB;
|
||||
|
@ -707,8 +706,8 @@ static int VID_ChoosePFD( PIXELFORMATDESCRIPTOR *pfd, int colorBits, int alphaBi
|
|||
if( pixelFormat )
|
||||
{
|
||||
attribs[0] = WGL_SAMPLES_ARB;
|
||||
pwglGetPixelFormatAttribiv( glw_state.hDC, pixelFormat, 0, 1, attribs, &samples );
|
||||
if( samples <= 1 ) Con_DPrintf( S_WARN "MSAA is not allowed\n" );
|
||||
pwglGetPixelFormatAttribiv( glw_state.hDC, pixelFormat, 0, 1, attribs, &glConfig.max_multisamples );
|
||||
if( glConfig.max_multisamples <= 1 ) Con_DPrintf( S_WARN "MSAA is not allowed\n" );
|
||||
|
||||
return pixelFormat;
|
||||
}
|
||||
|
@ -1481,6 +1480,9 @@ static void GL_SetDefaults( void )
|
|||
pglDepthFunc( GL_LEQUAL );
|
||||
pglColor4f( 1.0f, 1.0f, 1.0f, 1.0f );
|
||||
|
||||
if( glConfig.max_multisamples > 1 )
|
||||
pglEnable( GL_MULTISAMPLE_ARB );
|
||||
|
||||
if( glState.stencilEnabled )
|
||||
{
|
||||
pglDisable( GL_STENCIL_TEST );
|
||||
|
|
|
@ -103,7 +103,6 @@ Studio models are position independent, so the cache manager can move them.
|
|||
|
||||
// sequence flags
|
||||
#define STUDIO_LOOPING 0x0001
|
||||
#define STUDIO_LIGHT_FROM_ROOT 0x8000 // get lighting point from root bonepos not from entity origin
|
||||
|
||||
// bone flags
|
||||
#define STUDIO_HAS_NORMALS 0x0001
|
||||
|
|
Reference in New Issue