@@ -104,7 +104,7 @@ public LightViewer(Viewer viewer, TrainCar car, TrainCarViewer carViewer)
104
104
case LightType . Glow :
105
105
LightPrimitives . Add ( new LightGlowPrimitive ( this , Viewer . RenderProcess , light ) ) ;
106
106
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 ) ) ;
108
108
else
109
109
( LightPrimitives . Last ( ) as LightGlowPrimitive ) . SpecificGlowMaterial = LightGlowMaterial ;
110
110
break ;
@@ -154,11 +154,12 @@ public LightViewer(Viewer viewer, TrainCar car, TrainCarViewer carViewer)
154
154
UpdateActiveLightCone ( ) ;
155
155
}
156
156
157
- string DefineFullTexturePath ( string textureName )
157
+ string DefineFullTexturePath ( string textureName , bool searchSpecificTexture = false )
158
158
{
159
159
if ( File . Exists ( Path . Combine ( Path . GetDirectoryName ( Car . WagFilePath ) , textureName ) ) )
160
160
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 ) ) ;
162
163
if ( File . Exists ( Path . Combine ( Viewer . ContentPath , textureName ) ) )
163
164
return Path . Combine ( Viewer . ContentPath , textureName ) ;
164
165
return Path . Combine ( Viewer . ContentPath , "LightGlow.png" ) ;
0 commit comments