@@ -104,7 +104,7 @@ public LightViewer(Viewer viewer, TrainCar car, TrainCarViewer carViewer)
104104 case LightType . Glow :
105105 LightPrimitives . Add ( new LightGlowPrimitive ( this , Viewer . RenderProcess , light ) ) ;
106106 if ( light . Graphic != null )
107- ( LightPrimitives . Last ( ) as LightGlowPrimitive ) . SpecificGlowMaterial = viewer . MaterialManager . Load ( "LightGlow" , DefineFullTexturePath ( light . Graphic ) ) ;
107+ ( LightPrimitives . Last ( ) as LightGlowPrimitive ) . SpecificGlowMaterial = viewer . MaterialManager . Load ( "LightGlow" , DefineFullTexturePath ( light . Graphic , true ) ) ;
108108 else
109109 ( LightPrimitives . Last ( ) as LightGlowPrimitive ) . SpecificGlowMaterial = LightGlowMaterial ;
110110 break ;
@@ -154,11 +154,12 @@ public LightViewer(Viewer viewer, TrainCar car, TrainCarViewer carViewer)
154154 UpdateActiveLightCone ( ) ;
155155 }
156156
157- string DefineFullTexturePath ( string textureName )
157+ string DefineFullTexturePath ( string textureName , bool searchSpecificTexture = false )
158158 {
159159 if ( File . Exists ( Path . Combine ( Path . GetDirectoryName ( Car . WagFilePath ) , textureName ) ) )
160160 return Path . Combine ( Path . GetDirectoryName ( Car . WagFilePath ) , textureName ) ;
161- Trace . TraceWarning ( "Could not find light graphic {0} at {1}" , textureName , Path . Combine ( Path . GetDirectoryName ( Car . WagFilePath ) , textureName ) ) ;
161+ if ( searchSpecificTexture )
162+ Trace . TraceWarning ( "Could not find light graphic {0} at {1}" , textureName , Path . Combine ( Path . GetDirectoryName ( Car . WagFilePath ) , textureName ) ) ;
162163 if ( File . Exists ( Path . Combine ( Viewer . ContentPath , textureName ) ) )
163164 return Path . Combine ( Viewer . ContentPath , textureName ) ;
164165 return Path . Combine ( Viewer . ContentPath , "LightGlow.png" ) ;
0 commit comments