Skip to content

Commit

Permalink
Automatic merge of T1.5.1-1435-ge5b84141d and 12 pull requests
Browse files Browse the repository at this point in the history
- Pull request #892 at 1f5ba4c: Signal Function OPP_SIG_ID_TRAINPATH
- Pull request #961 at 8a9c8f9: Improvements for Power Supplies
- Pull request #981 at 1c53db2: Multiple type trainset lightglows
- Pull request #996 at 2fcbcde: Replace dynamic brakes by engine brakes at low speeds
- Pull request #1009 at 80172b8: Fix: TrainCarViewer overlaps when display size changed
- Pull request #1010 at 6a1060f: Fix: TrainDrivingInfo window width not stable.
- Pull request #1012 at fbb87b0: doc:adds 3 news items to Manual
- Pull request #1015 at 2759c59: Enhancements for EP brakes
- Pull request #900 at c27f32d: DMI updates
- Pull request #876 at f92de76: docs: add source for documents previously on website to source Documentation folder
- Pull request #896 at f1681df: First implementation of https://blueprints.launchpad.net/or/+spec/specific-sounds-for-ai-trains
- Pull request #1003 at c734592: Clean up logging during loading #or-std-log
  • Loading branch information
openrails-bot committed Dec 20, 2024
14 parents 09f9bf8 + e5b8414 + 1f5ba4c + 8a9c8f9 + 1c53db2 + 2fcbcde + 80172b8 + 6a1060f + fbb87b0 + 2759c59 + c27f32d + f92de76 + f1681df + c734592 commit 8f45b1e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Source/RunActivity/Viewer3D/Lights.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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");
Expand Down

0 comments on commit 8f45b1e

Please sign in to comment.