Skip to content

Commit 376cdc4

Browse files
committed
client: render: disabled purging dynamic lights that used for video projecting
1 parent 2781346 commit 376cdc4

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

client/render/cl_dlight.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ GNU General Public License for more details.
3333
#define DLF_ASPECT4X3 BIT( 5 )
3434
#define DLF_FLIPTEXTURE BIT( 6 )
3535
#define DLF_PARENTENTITY_NOSHADOW BIT( 7 )
36+
#define DLF_MOVIE BIT( 8 )
3637

3738
class CDynLight
3839
{

client/render/gl_dlight.cpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,15 +96,19 @@ void CL_DecayLights( void )
9696
float time = GET_CLIENT_TIME();
9797
CDynLight *pl = tr.dlights;
9898

99-
for( int i = 0; i < MAX_DLIGHTS; i++, pl++ )
99+
for (int i = 0; i < MAX_DLIGHTS; i++, pl++)
100100
{
101-
if( !pl->radius ) continue;
101+
if (!pl->radius)
102+
continue;
103+
104+
if (FBitSet(pl->flags, DLF_MOVIE))
105+
continue; // don't clean up dlights that used for video projecting
102106

103107
pl->radius -= tr.frametime * pl->decay;
104-
if( pl->radius < 0.0f ) pl->radius = 0.0f;
108+
if (pl->radius < 0.0f) pl->radius = 0.0f;
105109

106-
if( pl->Expired( ))
107-
memset( pl, 0, sizeof( *pl ));
110+
if (pl->Expired())
111+
memset(pl, 0, sizeof(*pl));
108112
}
109113
}
110114

client/render/gl_scene.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ static bool R_HandleLightEntity(cl_entity_t *ent)
479479
if (dlight->spotlightTexture == tr.spotlightTexture[1])
480480
return true; // invalid texture?
481481

482-
flags = DLF_ASPECT3X4; // fit to film01.avi aspect
482+
flags = DLF_ASPECT3X4 | DLF_MOVIE; // fit to film01.avi aspect
483483
type = LIGHT_SPOT;
484484

485485
if (!R_UpdateCinematicDynLight(entity.GetVideoFileIndex(), dlight))

0 commit comments

Comments
 (0)