Skip to content

Commit af36724

Browse files
committed
support turnoff and turnon on the projected video
1 parent 588e04b commit af36724

3 files changed

Lines changed: 15 additions & 1 deletion

File tree

sp/src/game/client/C_Env_Projected_Texture.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ class C_EnvProjectedTexture : public C_BaseEntity
106106
static float m_flVisibleBBoxMinHeight;
107107

108108
ITexture* m_pVideoMatTexture;
109+
110+
friend class C_EnvProjectedVideo;
109111
};
110112

111113

sp/src/game/client/c_env_projectedtexture.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ void C_EnvProjectedTexture::SetVideoMaterial( IMaterial* pVidMat )
146146
if (tex)
147147
{
148148
m_pVideoMatTexture = tex;
149-
m_LightHandle = CLIENTSHADOW_INVALID_HANDLE;
149+
ShutDownLightHandle();
150150
}
151151
}
152152
}

sp/src/game/shared/env_projectedvideo.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,12 +241,24 @@ void CEnvProjectedVideo::DestroyVideo()
241241
m_pVideoRT.Shutdown();
242242
m_pVideoRTMaterial.Shutdown();
243243
BaseClass::SetVideoMaterial(NULL);
244+
ShutDownLightHandle();
244245
}
245246

246247
}
247248

248249
void CEnvProjectedVideo::ClientThink()
249250
{
251+
252+
if (!m_bState)
253+
{
254+
if (m_pVideoMaterial)
255+
{
256+
DestroyVideo();
257+
}
258+
SetNextClientThink(CLIENT_THINK_ALWAYS);
259+
return;
260+
}
261+
250262
if (!m_pVideoMaterial)
251263
{
252264
CreateVideo();

0 commit comments

Comments
 (0)