Skip to content

Commit 9357ae7

Browse files
authored
Merge pull request #1154 from openrails/release/1.6
Merge pull request #1151 from twpol/feature/ace-dds-content-only
2 parents e3d1d75 + 0143dee commit 9357ae7

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

Source/Documentation/Manual/features-rollingstock.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ Detailed spec
345345
no changes are done to the .eng file.
346346
2) In such folder there is also an ``ORTSLightGlow.png``, which is maybe more realistic.
347347
3) adding a line within the .eng file it is possible to select either ORTSLightGlow.png or any other picture
348-
with extension ``.png, .jpg, bmp, .gif, .ace, or .dds``.
348+
with extension ``.ace`` or ``.dds``.
349349

350350

351351
Here an example for the legacy Acela loco::
@@ -357,13 +357,13 @@ Detailed spec
357357
Type ( 1 )
358358
Conditions (...
359359

360-
The code first searches for the .png file by building its directory starting from the directory of
360+
The code first searches for the file by building its directory starting from the directory of
361361
the .eng file; in this case the line could be e.g.::
362362

363-
ORTSGraphic ( "ORTSAcelaLightGlow.png" )
363+
ORTSGraphic ( "ORTSAcelaLightGlow.dds" )
364364

365365
4) The ``ORTSGraphic`` line can be added also for one or more ``Light()`` blocks. In that case the
366-
.png file is used only for the related Light block. Here an example::
366+
file is used only for the related Light block. Here an example::
367367

368368
Light (
369369
comment( Head light outer right bright )
@@ -386,7 +386,7 @@ Detailed spec
386386
Elevation ( -50 -50 -50 )
387387
)
388388
)
389-
ORTSGraphic (BigLightGlow.png)
389+
ORTSGraphic (BigLightGlow.dds)
390390
)
391391

392392
OR searches for the file as it does for the general file for all lights, as explained above.

Source/RunActivity/Viewer3D/Lights.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -988,7 +988,7 @@ public LightGlowMaterial(Viewer viewer, string textureName)
988988
: base(viewer, textureName)
989989
{
990990
// TODO: This should happen on the loader thread.
991-
LightGlowTexture = SharedTextureManager.Get(Viewer.RenderProcess.GraphicsDevice, textureName);
991+
LightGlowTexture = textureName.StartsWith(Viewer.ContentPath, StringComparison.OrdinalIgnoreCase) ? SharedTextureManager.Get(Viewer.RenderProcess.GraphicsDevice, textureName) : Viewer.TextureManager.Get(textureName);
992992
}
993993

994994
public override void SetState(GraphicsDevice graphicsDevice, Material previousMaterial)

Source/RunActivity/Viewer3D/MSTSSky.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -543,8 +543,8 @@ public MSTSSkyMaterial(Viewer viewer)
543543
string mstsSkySunTexture = Viewer.Simulator.RoutePath + @"\envfiles\textures\" + mstsskysatellitetexture[0].TextureName.ToString();
544544
string mstsSkyMoonTexture = Viewer.Simulator.RoutePath + @"\envfiles\textures\" + mstsskysatellitetexture[1].TextureName.ToString();
545545

546-
MSTSSkySunTexture = SharedTextureManager.Get(Viewer.RenderProcess.GraphicsDevice, mstsSkySunTexture);
547-
MSTSSkyMoonTexture = SharedTextureManager.Get(Viewer.RenderProcess.GraphicsDevice, mstsSkyMoonTexture);
546+
MSTSSkySunTexture = Viewer.TextureManager.Get(mstsSkySunTexture);
547+
MSTSSkyMoonTexture = Viewer.TextureManager.Get(mstsSkyMoonTexture);
548548
}
549549
else
550550
MSTSSkyMoonTexture = SharedTextureManager.Get(Viewer.RenderProcess.GraphicsDevice, System.IO.Path.Combine(Viewer.ContentPath, "MoonMap.png"));

Source/RunActivity/Viewer3D/Materials.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,10 @@ Texture2D invalid()
145145
}
146146
}
147147
else
148+
{
149+
Trace.TraceWarning("Unsupported texture format: {0}", path);
148150
return defaultTexture;
151+
}
149152

150153
Textures.Add(path, texture);
151154
return texture;

0 commit comments

Comments
 (0)