From 1c53db2fa19afce003cc278273515abc1147baac Mon Sep 17 00:00:00 2001 From: csantucci Date: Fri, 20 Dec 2024 18:27:26 +0100 Subject: [PATCH] Avoid wrong bunch of missing light graphic infos in logfile --- Source/RunActivity/Viewer3D/Lights.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Source/RunActivity/Viewer3D/Lights.cs b/Source/RunActivity/Viewer3D/Lights.cs index b72d0721a..f6c8088b1 100644 --- a/Source/RunActivity/Viewer3D/Lights.cs +++ b/Source/RunActivity/Viewer3D/Lights.cs @@ -104,7 +104,7 @@ public LightViewer(Viewer viewer, TrainCar car, TrainCarViewer carViewer) case LightType.Glow: LightPrimitives.Add(new LightGlowPrimitive(this, Viewer.RenderProcess, light)); if (light.Graphic != null) - (LightPrimitives.Last() as LightGlowPrimitive).SpecificGlowMaterial = viewer.MaterialManager.Load("LightGlow", DefineFullTexturePath(light.Graphic)); + (LightPrimitives.Last() as LightGlowPrimitive).SpecificGlowMaterial = viewer.MaterialManager.Load("LightGlow", DefineFullTexturePath(light.Graphic, true)); else (LightPrimitives.Last() as LightGlowPrimitive).SpecificGlowMaterial = LightGlowMaterial; break; @@ -154,11 +154,12 @@ public LightViewer(Viewer viewer, TrainCar car, TrainCarViewer carViewer) UpdateActiveLightCone(); } - string DefineFullTexturePath(string textureName) + string DefineFullTexturePath(string textureName, bool searchSpecificTexture = false) { if (File.Exists(Path.Combine(Path.GetDirectoryName(Car.WagFilePath), textureName))) return Path.Combine(Path.GetDirectoryName(Car.WagFilePath), textureName); - Trace.TraceWarning("Could not find light graphic {0} at {1}", textureName, Path.Combine(Path.GetDirectoryName(Car.WagFilePath), textureName)); + if (searchSpecificTexture) + Trace.TraceWarning("Could not find light graphic {0} at {1}", textureName, Path.Combine(Path.GetDirectoryName(Car.WagFilePath), textureName)); if (File.Exists(Path.Combine(Viewer.ContentPath, textureName))) return Path.Combine(Viewer.ContentPath, textureName); return Path.Combine(Viewer.ContentPath, "LightGlow.png");