Skip to content

Commit 0ff87d8

Browse files
authored
Merge pull request #659 from Csantucci/clock-3Dcab
Bug fix for https://bugs.launchpad.net/or/+bug/1979824 Seconds in digital clock within 3Dcab not displayed
2 parents edf9a73 + f38fc9b commit 0ff87d8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Source/RunActivity/Viewer3D/RollingStock/MSTSLocomotiveViewer.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3280,7 +3280,7 @@ internal override void Mark()
32803280

32813281
public class ThreeDimCabDigit
32823282
{
3283-
const int MaxDigits = 6;
3283+
int MaxDigits = 6;
32843284
PoseableShape TrainCarShape;
32853285
VertexPositionNormalTexture[] VertexList;
32863286
int NumVertices;
@@ -3306,10 +3306,12 @@ public ThreeDimCabDigit(Viewer viewer, int iMatrix, string size, string aceFile,
33063306
else { AceFile = ""; }
33073307

33083308
CVFR = (CabViewDigitalRenderer)c;
3309+
var digital = CVFR.Control as CVCDigital;
3310+
if (digital.ControlType == CABViewControlTypes.CLOCK && digital.Accuracy > 0) MaxDigits = 8;
33093311
Viewer = viewer;
33103312
TrainCarShape = trainCarShape;
33113313
XNAMatrix = TrainCarShape.SharedShape.Matrices[iMatrix];
3312-
var maxVertex = 32;// every face has max 5 digits, each has 2 triangles
3314+
var maxVertex = (MaxDigits + 2) * 4;// every face has max 8 digits, each has 2 triangles
33133315
//Material = viewer.MaterialManager.Load("Scenery", Helpers.GetRouteTextureFile(viewer.Simulator, Helpers.TextureFlags.None, texture), (int)(SceneryMaterialOptions.None | SceneryMaterialOptions.AlphaBlendingBlend), 0);
33143316
Material = FindMaterial(false);//determine normal material
33153317
// Create and populate a new ShapePrimitive

0 commit comments

Comments
 (0)