mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-02-09 13:44:24 +00:00
ref: soft: only draw MOVETYPE_FOLLOW studio model if it's parent is visible
This commit is contained in:
parent
dc1d65f621
commit
6862b14e59
@ -476,6 +476,7 @@ void R_SetupRefParams( const struct ref_viewpass_s *rvp );
|
|||||||
void R_TranslateForEntity( cl_entity_t *e );
|
void R_TranslateForEntity( cl_entity_t *e );
|
||||||
void R_RotateForEntity( cl_entity_t *e );
|
void R_RotateForEntity( cl_entity_t *e );
|
||||||
void R_SetupGL( qboolean set_gl_state );
|
void R_SetupGL( qboolean set_gl_state );
|
||||||
|
qboolean R_OpaqueEntity( cl_entity_t *ent );
|
||||||
void R_AllowFog( qboolean allowed );
|
void R_AllowFog( qboolean allowed );
|
||||||
void R_SetupFrustum( void );
|
void R_SetupFrustum( void );
|
||||||
void R_FindViewLeaf( void );
|
void R_FindViewLeaf( void );
|
||||||
|
@ -145,7 +145,7 @@ R_OpaqueEntity
|
|||||||
Opaque entity can be brush or studio model but sprite
|
Opaque entity can be brush or studio model but sprite
|
||||||
===============
|
===============
|
||||||
*/
|
*/
|
||||||
static qboolean R_OpaqueEntity( cl_entity_t *ent )
|
qboolean R_OpaqueEntity( cl_entity_t *ent )
|
||||||
{
|
{
|
||||||
int rendermode = R_GetEntityRenderMode( ent );
|
int rendermode = R_GetEntityRenderMode( ent );
|
||||||
|
|
||||||
|
@ -3293,7 +3293,7 @@ static int R_StudioDrawModel( int flags )
|
|||||||
R_StudioDrawModelInternal
|
R_StudioDrawModelInternal
|
||||||
=================
|
=================
|
||||||
*/
|
*/
|
||||||
void R_StudioDrawModelInternal( cl_entity_t *e, int flags )
|
static void R_StudioDrawModelInternal( cl_entity_t *e, int flags )
|
||||||
{
|
{
|
||||||
if( !RI.drawWorld )
|
if( !RI.drawWorld )
|
||||||
{
|
{
|
||||||
@ -3326,26 +3326,47 @@ void R_DrawStudioModel( cl_entity_t *e )
|
|||||||
{
|
{
|
||||||
R_StudioDrawModelInternal( e, STUDIO_RENDER|STUDIO_EVENTS );
|
R_StudioDrawModelInternal( e, STUDIO_RENDER|STUDIO_EVENTS );
|
||||||
}
|
}
|
||||||
else
|
else if( e->curstate.movetype == MOVETYPE_FOLLOW && e->curstate.aiment > 0 )
|
||||||
{
|
{
|
||||||
if( e->curstate.movetype == MOVETYPE_FOLLOW && e->curstate.aiment > 0 )
|
cl_entity_t *parent = CL_GetEntityByIndex( e->curstate.aiment ), **entities;
|
||||||
{
|
uint i, num_entities;
|
||||||
cl_entity_t *parent = CL_GetEntityByIndex( e->curstate.aiment );
|
|
||||||
|
|
||||||
if( parent && parent->model && parent->model->type == mod_studio )
|
if( !parent || !parent->model || parent->model->type != mod_studio )
|
||||||
{
|
return;
|
||||||
RI.currententity = parent;
|
|
||||||
R_StudioDrawModelInternal( RI.currententity, 0 );
|
if( R_OpaqueEntity( parent ))
|
||||||
VectorCopy( parent->curstate.origin, e->curstate.origin );
|
{
|
||||||
VectorCopy( parent->origin, e->origin );
|
entities = tr.draw_list->solid_entities;
|
||||||
RI.currententity = e;
|
num_entities = tr.draw_list->num_solid_entities;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
entities = tr.draw_list->trans_entities;
|
||||||
|
num_entities = tr.draw_list->num_solid_entities;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for( i = 0; i < num_entities; i++ )
|
||||||
|
{
|
||||||
|
if( (*entities)[i].index != e->curstate.aiment )
|
||||||
|
continue;
|
||||||
|
|
||||||
|
RI.currententity = &(*entities)[i];
|
||||||
|
R_StudioDrawModelInternal( RI.currententity, 0 );
|
||||||
|
VectorCopy( RI.currententity->curstate.origin, e->curstate.origin );
|
||||||
|
VectorCopy( RI.currententity->origin, e->origin );
|
||||||
|
RI.currententity = e;
|
||||||
|
|
||||||
|
R_StudioDrawModelInternal( e, STUDIO_RENDER|STUDIO_EVENTS );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
R_StudioDrawModelInternal( e, STUDIO_RENDER|STUDIO_EVENTS );
|
R_StudioDrawModelInternal( e, STUDIO_RENDER|STUDIO_EVENTS );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
=================
|
=================
|
||||||
R_RunViewmodelEvents
|
R_RunViewmodelEvents
|
||||||
|
Loading…
x
Reference in New Issue
Block a user