mirror of
https://github.com/FWGS/xash3d-fwgs.git
synced 2026-08-05 03:24:56 +08:00
ref: make R_GatherPlayerLight shared between renderers
This commit is contained in:
@@ -81,6 +81,7 @@ void R_PushDlightsForBmodel( model_t *model, int framecount, const matrix4x4 obj
|
||||
int R_PushDlights( model_t *model, int framecount );
|
||||
colorVec R_LightVec( const vec3_t start, const vec3_t end, vec3_t lspot, vec3_t lvec );
|
||||
colorVec R_LightPoint( const vec3_t p0 );
|
||||
void R_GatherPlayerLight( cl_entity_t *view );
|
||||
void R_UpdateSurfaceCachedLight( msurface_t *surf );
|
||||
|
||||
//
|
||||
|
||||
@@ -475,6 +475,20 @@ colorVec R_LightPoint( const vec3_t p0 )
|
||||
return R_LightVec( p0, p1, NULL, NULL );
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
R_GatherPlayerLight
|
||||
|
||||
get light level of an entity and set it as player's light level
|
||||
=================
|
||||
*/
|
||||
void R_GatherPlayerLight( cl_entity_t *view )
|
||||
{
|
||||
colorVec c = R_LightPoint( view->origin );
|
||||
|
||||
gEngfuncs.SetLocalLightLevel(( c.r + c.g + c.b ) / 3 );
|
||||
}
|
||||
|
||||
/*
|
||||
================
|
||||
R_SetCacheState
|
||||
|
||||
@@ -409,7 +409,6 @@ struct mstudiotex_s *R_StudioGetTexture( cl_entity_t *e );
|
||||
int R_GetEntityRenderMode( cl_entity_t *ent );
|
||||
void R_DrawStudioModel( cl_entity_t *e );
|
||||
player_info_t *pfnPlayerInfo( int index );
|
||||
void R_GatherPlayerLight( void );
|
||||
float R_StudioEstimateFrame( cl_entity_t *e, mstudioseqdesc_t *pseqdesc, double time );
|
||||
void R_StudioLerpMovement( cl_entity_t *e, double time, vec3_t origin, vec3_t angles );
|
||||
void R_StudioResetPlayerModels( void );
|
||||
|
||||
@@ -1105,7 +1105,7 @@ void R_RenderFrame( const ref_viewpass_t *rvp )
|
||||
|
||||
if( gEngfuncs.drawFuncs->GL_RenderFrame( rvp ))
|
||||
{
|
||||
R_GatherPlayerLight();
|
||||
R_GatherPlayerLight( tr.viewent );
|
||||
tr.realframecount++;
|
||||
tr.fResetVis = true;
|
||||
return;
|
||||
|
||||
@@ -3594,20 +3594,6 @@ void R_RunViewmodelEvents( void )
|
||||
R_StudioDrawModelInternal( RI.currententity, STUDIO_EVENTS );
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
R_GatherPlayerLight
|
||||
=================
|
||||
*/
|
||||
void R_GatherPlayerLight( void )
|
||||
{
|
||||
cl_entity_t *view = tr.viewent;
|
||||
colorVec c;
|
||||
|
||||
c = R_LightPoint( view->origin );
|
||||
gEngfuncs.SetLocalLightLevel( ( c.r + c.g + c.b ) / 3 );
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
R_DrawViewModel
|
||||
@@ -3617,7 +3603,7 @@ void R_DrawViewModel( void )
|
||||
{
|
||||
cl_entity_t *view = tr.viewent;
|
||||
|
||||
R_GatherPlayerLight();
|
||||
R_GatherPlayerLight( view );
|
||||
|
||||
if( r_drawviewmodel->value == 0 )
|
||||
return;
|
||||
|
||||
@@ -399,7 +399,6 @@ struct mstudiotex_s *R_StudioGetTexture( cl_entity_t *e );
|
||||
int R_GetEntityRenderMode( cl_entity_t *ent );
|
||||
void R_DrawStudioModel( cl_entity_t *e );
|
||||
player_info_t *pfnPlayerInfo( int index );
|
||||
void R_GatherPlayerLight( void );
|
||||
float R_StudioEstimateFrame( cl_entity_t *e, mstudioseqdesc_t *pseqdesc, double time );
|
||||
void R_StudioLerpMovement( cl_entity_t *e, double time, vec3_t origin, vec3_t angles );
|
||||
void R_StudioResetPlayerModels( void );
|
||||
|
||||
@@ -1172,7 +1172,7 @@ void GAME_EXPORT R_RenderFrame( const ref_viewpass_t *rvp )
|
||||
|
||||
if( gEngfuncs.drawFuncs->GL_RenderFrame( rvp ))
|
||||
{
|
||||
// R_GatherPlayerLight();
|
||||
// R_GatherPlayerLight( tr.viewent );
|
||||
tr.realframecount++;
|
||||
tr.fResetVis = true;
|
||||
return;
|
||||
|
||||
@@ -3125,20 +3125,6 @@ void R_RunViewmodelEvents( void )
|
||||
R_StudioDrawModelInternal( RI.currententity, STUDIO_EVENTS );
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
R_GatherPlayerLight
|
||||
=================
|
||||
*/
|
||||
void R_GatherPlayerLight( void )
|
||||
{
|
||||
cl_entity_t *view = tr.viewent;
|
||||
colorVec c;
|
||||
|
||||
c = R_LightPoint( view->origin );
|
||||
gEngfuncs.SetLocalLightLevel(( c.r + c.g + c.b ) / 3 );
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
R_DrawViewModel
|
||||
@@ -3148,7 +3134,7 @@ void R_DrawViewModel( void )
|
||||
{
|
||||
cl_entity_t *view = tr.viewent;
|
||||
|
||||
R_GatherPlayerLight();
|
||||
R_GatherPlayerLight( view );
|
||||
|
||||
if( r_drawviewmodel->value == 0 )
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user