Skip to content

Commit 9d8f392

Browse files
author
Chris Jakeman
committed
Removed option Cab 2D Stretch.
1 parent 48f7111 commit 9d8f392

File tree

9 files changed

+55
-102
lines changed

9 files changed

+55
-102
lines changed

Source/Documentation/Manual/driving.rst

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,33 @@ your train will be in motion or stopped. To look around in the simulation, you
2525
can select different views using the keyboard, as described in
2626
:ref:`Changing the View <driving-changing-view>`.
2727

28+
Cab Letter-Boxing
29+
----------------
30+
31+
OR manages not only cab interiors using 2D images in a MSTS-compatible
32+
way, but also supports 3D models. Most 2D cab images follow MSTS practice,
33+
being 1024 x 768 pixels to suit monitors with a 4:3 aspect ratio.
34+
35+
.. image:: images/options-2dstretch_1.png
36+
37+
So, the problem arises -- how to display these 4:3 cabs on a 16:9 or 16:10
38+
monitor?
39+
40+
One possibility is to enlarge these images to fill the width of wider monitors,
41+
as shown in the image below.
42+
43+
In doing so, we lose a portion from the top and bottom of the image.
44+
You can use the Up and Down Arrow keys to pan and reveal these missing portions.
45+
46+
.. image:: images/options-2dstretch_2.png
47+
48+
Instead of enlarging the image, OR can also 'letterbox' it by showing the full height
49+
and filling the missing space with black bars.
50+
You can activate this mode in-game by pressing Ctrl+1.
51+
52+
.. image:: images/options-2dstretch_3.png
53+
54+
2855
Open Rails Driving Controls
2956
===========================
3057

772 Bytes
Loading

Source/Documentation/Manual/options.rst

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -283,41 +283,6 @@ may see stuttering or image "tearing". To prevent this, either turn off
283283
the VSync option or reduce the values for video options such as view
284284
distance, anti-aliasing, or world object density.
285285

286-
.. _options-cab-stretch:
287-
288-
% Cab 2D stretch
289-
----------------
290-
291-
OR manages not only cab interiors using 2D images in a MSTS-compatible
292-
way, but also supports 3D models. Most 2D cab images follow MSTS practice,
293-
being 1024 x 768 pixels to suit monitors with a 4:3 aspect ratio.
294-
295-
So, the problem arises -- how to display these 4:3 cabs on a 16:9 or 16:10
296-
monitor?
297-
298-
One possibility is to stretch these images horizontally to match other
299-
aspect ratios, as shown in the image below.
300-
301-
.. image:: images/options-2dstretch_1.png
302-
303-
To respect the proportions however, by default OR does no stretching and
304-
shows the full width of the cab interior, thus losing a portion from the
305-
top and bottom of the image. You can use the Up and Down Arrow keys to pan
306-
and reveal these missing portions.
307-
308-
Therefore the setting for % Cab 2D Stretch has a default value of 0
309-
providing no stretching and a maximum value of 100 which stretches the
310-
picture so as to cover the complete display. Intermediate values provide a
311-
blend of panning and stretching.
312-
313-
.. image:: images/options-2dstretch_2.png
314-
315-
OR can also pillarbox or letterbox the cab by filling the missing space with
316-
black bars. You can activate this mode in-game by pressing Ctrl+1. It overrides
317-
any stretching.
318-
319-
.. image:: images/options-2dstretch_3.png
320-
321286
Viewing distance
322287
----------------
323288

Source/Menu/Options.Designer.cs

Lines changed: 18 additions & 50 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Source/Menu/Options.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,6 @@ public OptionsForm(UserSettings settings, UpdateManager updateManager, bool init
167167
checkModelInstancing.Checked = Settings.ModelInstancing;
168168
checkWire.Checked = Settings.Wire;
169169
checkVerticalSync.Checked = Settings.VerticalSync;
170-
numericCab2DStretch.Value = Settings.Cab2DStretch;
171170
numericViewingDistance.Value = Settings.ViewingDistance;
172171
checkDistantMountains.Checked = Settings.DistantMountains;
173172
labelDistantMountainsViewingDistance.Enabled = checkDistantMountains.Checked;
@@ -457,7 +456,6 @@ void buttonOK_Click(object sender, EventArgs e)
457456
Settings.ModelInstancing = checkModelInstancing.Checked;
458457
Settings.Wire = checkWire.Checked;
459458
Settings.VerticalSync = checkVerticalSync.Checked;
460-
Settings.Cab2DStretch = (int)numericCab2DStretch.Value;
461459
Settings.ViewingDistance = (int)numericViewingDistance.Value;
462460
Settings.DistantMountains = checkDistantMountains.Checked;
463461
Settings.DistantMountainsViewingDistance = (int)numericDistantMountainsViewingDistance.Value * 1000;

Source/Menu/Options.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,4 +126,7 @@
126126
<metadata name="bindingSourceContent.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
127127
<value>114, 17</value>
128128
</metadata>
129+
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
130+
<value>17, 17</value>
131+
</metadata>
129132
</root>

Source/ORTS.Settings/UserSettings.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,6 @@ public enum DirectXFeature
206206
public bool Wire { get; set; }
207207
[Default(false)]
208208
public bool VerticalSync { get; set; }
209-
[Default(0)]
210-
public int Cab2DStretch { get; set; }
211209
[Default(2000)]
212210
public int ViewingDistance { get; set; }
213211
[Default(true)]

Source/RunActivity/Viewer3D/Cameras.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2040,7 +2040,7 @@ public void Initialize()
20402040
float fovFactor = 1f - Math.Max((float)Viewer.CabXLetterboxPixels / Viewer.DisplaySize.X, (float)Viewer.CabYLetterboxPixels / Viewer.DisplaySize.Y);
20412041
FieldOfView = MathHelper.ToDegrees((float)(2 * Math.Atan(fovFactor * Math.Tan(MathHelper.ToRadians(Viewer.Settings.ViewingFOV / 2)))));
20422042
}
2043-
else if (Viewer.Settings.Cab2DStretch == 0 && Viewer.CabExceedsDisplayHorizontally <= 0)
2043+
else if (Viewer.CabExceedsDisplayHorizontally <= 0)
20442044
{
20452045
// We must modify FOV to get correct lookout
20462046
FieldOfView = MathHelper.ToDegrees((float)(2 * Math.Atan((float)Viewer.DisplaySize.Y / Viewer.DisplaySize.X / Viewer.CabTextureInverseRatio * Math.Tan(MathHelper.ToRadians(Viewer.Settings.ViewingFOV / 2)))));

Source/RunActivity/Viewer3D/Viewer.cs

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -202,13 +202,9 @@ enum VisibilityState
202202

203203
// MSTS cab views are images with aspect ratio 4:3.
204204
// OR can use cab views with other aspect ratios where these are available.
205-
// On screen with other aspect ratios (e.g. 16:9), three approaches are possible:
206-
// 1) stretch the width to fit the screen. This gives flattened controls, most noticeable with round dials.
207-
// 2) clip the image losing a slice off top and bottom.
208-
// 3) letterbox the image by drawing black bars in the unfilled spaces.
209-
// Setting.Cab2DStretch controls the amount of stretch and clip. 0 is entirely clipped and 100 is entirely stretched.
210-
// No difference is seen on screens with 4:3 aspect ratio.
211-
// This adjustment assumes that the cab view is 4:3. Where the cab view matches the aspect ratio of the screen, use an adjustment of 100.
205+
// On screen with other aspect ratios (e.g. 16:9), two approaches are possible:
206+
// 1) clip the image losing a slice off top and bottom. Use arrow keys to bring these slices into view.
207+
// 2) letterbox the image by drawing black bars in the unfilled spaces.
212208
public int CabHeightPixels { get; private set; }
213209
public int CabWidthPixels { get; private set; }
214210
public int CabYOffsetPixels { get; set; } // Note: Always -ve. Without it, the cab view is fixed to the top of the screen. -ve values pull it up the screen.
@@ -701,11 +697,9 @@ public void AdjustCabHeight(int windowWidth, int windowHeight)
701697
// MSTS cab views are designed for 4:3 aspect ratio. This is the default. However a check is done with the actual
702698
// cabview texture. If this has a different aspect ratio, that one is considered
703699
// For wider screens (e.g. 16:9), the height of the cab view before adjustment exceeds the height of the display.
704-
// The user can decide how much of this excess to keep. Setting of 0 keeps all the excess and 100 keeps none.
705700

706-
// <CSComment> If the aspect ratio of the viewing window is greater than the aspect ratio of the cabview texture file
707-
// it is either possible to stretch the cabview texture file or to leave the proportions unaltered and to vertically pan
708-
// the screen
701+
// <CSComment> If the aspect ratio of the viewing window is greater than the aspect ratio of the cabview texture file,
702+
// it is possible to vertically pan the screen.
709703
if (CabCamera.IsAvailable)
710704
{
711705
var i = ((PlayerLocomotive as MSTSLocomotive).UsingRearCab) ? 1 : 0;
@@ -735,7 +729,7 @@ public void AdjustCabHeight(int windowWidth, int windowHeight)
735729
else if (windowInverseRatio < CabTextureInverseRatio)
736730
{
737731
// screen is wide-screen, so can choose between vertical scroll or horizontal stretch
738-
CabExceedsDisplay = (int)((unstretchedCabHeightPixels - windowHeight) * ((100 - Settings.Cab2DStretch) / 100f));
732+
CabExceedsDisplay = (int)(unstretchedCabHeightPixels - windowHeight);
739733
CabExceedsDisplayHorizontally = 0;
740734
}
741735
else

0 commit comments

Comments
 (0)