Skip to content

Commit

Permalink
Merged branch master into release
Browse files Browse the repository at this point in the history
  • Loading branch information
leezer3 committed Sep 25, 2016
2 parents ba9bc9d + 3d04e34 commit bf829f0
Show file tree
Hide file tree
Showing 21 changed files with 632 additions and 163 deletions.
Binary file modified Dependencies/MacBundle.tgz
Binary file not shown.
15 changes: 13 additions & 2 deletions Documentation/HTML/object_animated.html
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,8 @@
<tr><td bgcolor="#FFFFFF" style=" border: 2px; border-style: ridge; padding: 4px;"><tt>Floor[<em>x</em>]</tt></td><td bgcolor="#FFFFFF" style=" border: 2px; border-style: ridge; padding: 4px;">Rounds down to the nearest integer.</td></tr>
<tr><td bgcolor="#FFFFFF" style=" border: 2px; border-style: ridge; padding: 4px;"><tt>Ceiling[<em>x</em>]</tt></td><td bgcolor="#FFFFFF" style=" border: 2px; border-style: ridge; padding: 4px;">Rounds up to the nearest integer.</td></tr>
<tr><td bgcolor="#FFFFFF" style=" border: 2px; border-style: ridge; padding: 4px;"><tt>Round[<em>x</em>]</tt></td><td bgcolor="#FFFFFF" style=" border: 2px; border-style: ridge; padding: 4px;">Rounds to the nearest integer. Numbers ending in .5 are rounded to the nearest even integer.</td></tr>
<tr><td bgcolor="#FFFFFF" style=" border: 2px; border-style: ridge; padding: 4px;"><tt>random[<em>Minimum</em>, <em>Maximum</em>]</tt></td><td bgcolor="#FFFFFF" style=" border: 2px; border-style: ridge; padding: 4px;">Returns a new random floating-point number between <em>Minimum</em> and <em>Maximum</em>.</td></tr>
<tr><td bgcolor="#FFFFFF" style=" border: 2px; border-style: ridge; padding: 4px;"><tt>randomInt[<em>Minimum</em>, <em>Maximum</em>]</tt></td><td bgcolor="#FFFFFF" style=" border: 2px; border-style: ridge; padding: 4px;">Returns a new random integer between <em>Minimum</em> and <em>Maximum</em>.</td></tr>
</table><br />
<table><tr style="height: 4px;"><td /></tr></table>
<font color="#0080FF">● Elementary functions</font>
Expand Down Expand Up @@ -376,6 +378,7 @@
<tr><th bgcolor="#D0D0D0" style=" border: 2px; border-style: ridge; padding: 4px;">Variable</th><th bgcolor="#D0D0D0" style=" border: 2px; border-style: ridge; padding: 4px;">Description</th></tr>
<tr><td bgcolor="#FFFFFF" style=" border: 2px; border-style: ridge; padding: 4px;"><tt>value</tt></td><td bgcolor="#FFFFFF" style=" border: 2px; border-style: ridge; padding: 4px;">The value returned by the function in the last evaluation. At the beginning of the simulation, this is 0.</td></tr>
<tr><td bgcolor="#FFFFFF" style=" border: 2px; border-style: ridge; padding: 4px;"><tt>delta</tt></td><td bgcolor="#FFFFFF" style=" border: 2px; border-style: ridge; padding: 4px;">The time difference since the last evaluation of the function in seconds. Please note that there is no guaranteed time that elapses between successive function calls.</td></tr>
<tr><td bgcolor="#FFFFFF" style=" border: 2px; border-style: ridge; padding: 4px;"><tt>currentState</tt></td><td bgcolor="#FFFFFF" style=" border: 2px; border-style: ridge; padding: 4px;">Returns the current numerical state of the object.</td></tr>
</table><br />
<table><tr style="height: 4px;"><td /></tr></table>
<font color="#0080FF">● Time and camera</font>
Expand All @@ -389,6 +392,7 @@
<tr><th bgcolor="#D0D0D0" style=" border: 2px; border-style: ridge; padding: 4px;">Variable</th><th bgcolor="#D0D0D0" style=" border: 2px; border-style: ridge; padding: 4px;">Description</th></tr>
<tr><td bgcolor="#FFFFFF" style=" border: 2px; border-style: ridge; padding: 4px;"><tt>time</tt></td><td bgcolor="#FFFFFF" style=" border: 2px; border-style: ridge; padding: 4px;">The current in-game time measured in seconds since midnight of the first day.</td></tr>
<tr><td bgcolor="#FFFFFF" style=" border: 2px; border-style: ridge; padding: 4px;"><tt>cameraDistance</tt></td><td bgcolor="#FFFFFF" style=" border: 2px; border-style: ridge; padding: 4px;">The non-negative cartesian distance measured from the object to the camera in meters.</td></tr>
<tr><td bgcolor="#FFFFFF" style=" border: 2px; border-style: ridge; padding: 4px;"><tt>cameraMode</tt></td><td bgcolor="#FFFFFF" style=" border: 2px; border-style: ridge; padding: 4px;">Returns 0 if the camera is currently in a 2D or 3D cab, 1 otherwise.</td></tr>
</table><br />
<table><tr style="height: 4px;"><td /></tr></table>
<font color="#0080FF">● Trains</font>
Expand Down Expand Up @@ -418,8 +422,8 @@
<tr><td bgcolor="#FFFFFF" style=" border: 2px; border-style: ridge; padding: 4px;"><tt>accelerationMotor[<em>carIndex</em>]</tt></td><td bgcolor="#FFFFFF" style=" border: 2px; border-style: ridge; padding: 4px;">The acceleration which the motor of the car <em>carIndex</em> currently generates in m/s².</td></tr>
<tr><td bgcolor="#FFFFFF" style=" border: 2px; border-style: ridge; padding: 4px;"><tt>distance</tt></td><td bgcolor="#FFFFFF" style=" border: 2px; border-style: ridge; padding: 4px;">The non-negative cartesian distance measured from the object to the closest car in meters. Only meaningful for scenery objects.</td></tr>
<tr><td bgcolor="#FFFFFF" style=" border: 2px; border-style: ridge; padding: 4px;"><tt>distance[<em>carIndex</em>]</tt></td><td bgcolor="#FFFFFF" style=" border: 2px; border-style: ridge; padding: 4px;">The non-negative cartesian distance measured from the object to the car <em>carIndex</em> in meters, or 0 if the car does not exist. Only meaningful for scenery objects.</td></tr>
<tr><td bgcolor="#FFFFFF" style=" border: 2px; border-style: ridge; padding: 4px;"><tt>trackDistance</tt></td><td bgcolor="#FFFFFF" style=" border: 2px; border-style: ridge; padding: 4px;">The signed track distance measured from the object to the closest end of the train in meters. Is positive when the train is in front of the object, negative when behind, and zero when the object lies between the ends of the train. Only meaningful for scenery objects. <b>Deprecated. The behavior of this variable may change in future versions of openBVE.</b></td></tr>
<tr><td bgcolor="#FFFFFF" style=" border: 2px; border-style: ridge; padding: 4px;"><tt>trackDistance[<em>carIndex</em>]</tt></td><td bgcolor="#FFFFFF" style=" border: 2px; border-style: ridge; padding: 4px;">The signed track distance measured from the object to the car <em>carIndex</em> in meters. Is positive when the center of the car is in front of the object, and negative if behind. Returns 0 if the car does not exist. Only meaningful for scenery objects. <b>Deprecated. The behavior of this variable may change in future versions of openBVE.</b></td></tr>
<tr><td bgcolor="#FFFFFF" style=" border: 2px; border-style: ridge; padding: 4px;"><tt>trackDistance</tt></td><td bgcolor="#FFFFFF" style=" border: 2px; border-style: ridge; padding: 4px;">The signed track distance measured from the object to the closest end of the nearest train in meters. Is positive when the train is in front of the object, negative when behind, and zero when the object lies between the ends of the train.</td></tr>
<tr><td bgcolor="#FFFFFF" style=" border: 2px; border-style: ridge; padding: 4px;"><tt>trackDistance[<em>carIndex</em>]</tt></td><td bgcolor="#FFFFFF" style=" border: 2px; border-style: ridge; padding: 4px;">The signed track distance measured from the object to the car <em>carIndex</em> of the nearest train in meters. Is positive when the center of the car is in front of the object, and negative if behind. Returns 0 if the car does not exist. Only meaningful for scenery objects.</td></tr>
</table><br />
<table><tr style="height: 4px;"><td /></tr></table>
<font color="#0080FF">● Trains (brake)</font>
Expand Down Expand Up @@ -521,6 +525,13 @@
<tr><td bgcolor="#FFFFFF" style=" border: 2px; border-style: ridge; padding: 4px;"><tt>hasConstSpeed</tt></td><td bgcolor="#FFFFFF" style=" border: 2px; border-style: ridge; padding: 4px;">Whether the train has a const speed system (1) or not (0).</td></tr>
<tr><td bgcolor="#FFFFFF" style=" border: 2px; border-style: ridge; padding: 4px;"><tt>hasPlugin</tt></td><td bgcolor="#FFFFFF" style=" border: 2px; border-style: ridge; padding: 4px;">Whether the train uses a plugin (1) or not (0).</td></tr>
<tr><td bgcolor="#FFFFFF" style=" border: 2px; border-style: ridge; padding: 4px;"><tt>pluginState[<em>i</em>]</tt></td><td bgcolor="#FFFFFF" style=" border: 2px; border-style: ridge; padding: 4px;">The state of the i<sup>th</sup> plugin variable, returning an integer depending on the plugin. Is the same as ats<em>i</em> in the panel2.cfg.</td></tr>

<tr><td bgcolor="#FFFFFF" style=" border: 2px; border-style: ridge; padding: 4px;"><tt>FrontAxleCurveRadius[<em>carIndex</em>]</tt></td><td bgcolor="#FFFFFF" style=" border: 2px; border-style: ridge; padding: 4px;">Returns the curve radius at the front axle position of car <em>carIndex</em>.</td></tr>
<tr><td bgcolor="#FFFFFF" style=" border: 2px; border-style: ridge; padding: 4px;"><tt>RearAxleCurveRadius[<em>carIndex</em>]</tt></td><td bgcolor="#FFFFFF" style=" border: 2px; border-style: ridge; padding: 4px;">Returns the curve radius at the rear axle position of car <em>carIndex</em>.</td></tr>
<tr><td bgcolor="#FFFFFF" style=" border: 2px; border-style: ridge; padding: 4px;"><tt>CurveCant[<em>carIndex</em>]</tt></td><td bgcolor="#FFFFFF" style=" border: 2px; border-style: ridge; padding: 4px;">Returns the cant value for car <em>carIndex</em>.</td></tr>
<tr><td bgcolor="#FFFFFF" style=" border: 2px; border-style: ridge; padding: 4px;"><tt>Odometer</tt></td><td bgcolor="#FFFFFF" style=" border: 2px; border-style: ridge; padding: 4px;">Returns a signed number representing the distance in meters travelled by the current car.</td></tr>
<tr><td bgcolor="#FFFFFF" style=" border: 2px; border-style: ridge; padding: 4px;"><tt>Odometer[<em>carIndex</em>]</tt></td><td bgcolor="#FFFFFF" style=" border: 2px; border-style: ridge; padding: 4px;">Returns a signed number representing the distance in meters travelled by car <em>carIndex</em>.</td></tr>
<tr><td bgcolor="#FFFFFF" style=" border: 2px; border-style: ridge; padding: 4px;"><tt>Klaxon</tt></td><td bgcolor="#FFFFFF" style=" border: 2px; border-style: ridge; padding: 4px;">Returns the currently playing horn (if any) as follows: (0) No horns are playing (1) The primary horn is playing (2) The secondary horn is playing (3) The music horn is playing. <em>Note</em> If multiple horns are playing, the lowest value will be returned.</td></tr>
</table><br />
If <em>pluginState[i]</em> is used with the built-in safety systems ATS and ATC, the following mappings for <em>i</em> apply:<br /><br />
<table style="border-collapse: collapse;">
Expand Down
89 changes: 85 additions & 4 deletions Documentation/HTML/train_panel2_cfg.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@
<a href="#needle">5. The Needle section</a><br />
<a href="#digitalnumber">6. The DigitalNumber section</a><br />
<a href="#digitalgauge">7. The DigitalGauge section</a><br />
<a href="#timetable">8. The Timetable section</a><br />
<a href="#subjects">9. Available subjects</a><br />
<a href="#lineargauge">8. The LinearGauge section</a><br />
<a href="#timetable">9. The Timetable section</a><br />
<a href="#subjects">10. Available subjects</a><br />
<br /><a name="overview" />
<br /><table><tr style="height: 4px;"><td /></tr></table>
<font size="+1" color="#0080FF">■ 1. Overview</font><hr />
Expand Down Expand Up @@ -567,6 +568,86 @@
<tr><td><font color="#808080">
<b><em>Value</em></b>: A floating-point value representing the step in which values on the solid-color square can increase. The value to be displayed via the solid-color square will be rounded down to the next integer multiple of <em>Value</em>. If <em>Value</em> is negative, values will be rounded up to the absolute value of <em>Value</em> instead. If <em>Value</em> is 0, increases will be smooth. The default value is 0.
</font></td></tr></table>
<br /><table border="0">
<tr style="height:16"><td></td></tr>
<tr><td bgcolor="#F0F0F0" style="font-family: monospace;border:1px dotted;color:#808080"><font color="#C00000">Layer = <em>LayerIndex</em></font></td></tr>
</table>
<table style="border:0px none;margin-left:10pt;margin-right:10pt;">
<tr><td><font color="#808080">
<b><em>LayerIndex</em></b>: An integer which uniquely defines this element among overlapping elements. Lower numbers represent the background and higher numbers the foreground. Elements may use the same <em>LayerIndex</em> as long as they do not overlap. The default value is 0.
</font></td></tr></table>
<br /><a name="lineargauge" />
<br /><table><tr style="height: 4px;"><td /></tr></table>
<font size="+1" color="#0080FF">■ 8. The LinearGauge section</font><hr />
<table style="border:0px none;margin-left:10pt;margin-right:10pt;">
<tr><td><font size="-1" color="#808080">

</font></td></tr></table>
The LinearGauge section creates a panel layer, which uses texture shifting to create a sliding linear gauge. You can use as many of these sections as required.<br /><br />Consider a standard openBVE face:<br /><br /><img src="../Images/texturecoords.png" alt="" /><br /><br />
As you can see, the horizontal texture-coordinates upon this face are 0 at the <b>right</b> and 1 at the <b>left</b>.
<br />
Thus, the value given by <em>Minimum</em> represents 0 <em>Maximum</em>, represents 1, and the current value may then be calculated as a simple percentage.<br /><br />
Further, the direction of the texture shift may be changed from horizontal to vertical (or both) by using the <b>Direction</b> parameter.
<table border="0">
<tr style="height:16"><td></td></tr>
<tr><td bgcolor="#F0F0F0" style="font-family: monospace;border:1px dotted;color:#808080"><font color="#C00000">[LinearGauge]</font></td></tr>
</table>
<table style="border:0px none;margin-left:10pt;margin-right:10pt;">
<tr><td><font color="#808080">

</font></td></tr></table>
This starts the section.<br /><br /><table border="0">
<tr style="height:16"><td></td></tr>
<tr><td bgcolor="#F0F0F0" style="font-family: monospace;border:1px dotted;color:#808080"><font color="#C00000">Subject = <em>Subject</em></font></td></tr>
</table>
<table style="border:0px none;margin-left:10pt;margin-right:10pt;">
<tr><td><font color="#808080">
<b><em>Subject</em></b>: One of the <a href="train_panel2_cfg.html#subjects">available subjects</a>. The default subject is <b>true</b>.
</font></td></tr></table>
<br /><table border="0">
<tr style="height:16"><td></td></tr>
<tr><td bgcolor="#F0F0F0" style="font-family: monospace;border:1px dotted;color:#808080"><font color="#C00000">Location = <em>CenterX</em>, <em>CenterY</em></font></td></tr>
</table>
<table style="border:0px none;margin-left:10pt;margin-right:10pt;">
<tr><td><font color="#808080">
<b><em>CenterX</em></b>: A floating-point number representing the x-coordinate at which the left of the image is inserted. The default value is 0.<br />
<b><em>CenterY</em></b>: A floating-point number representing the y-coordinate at which the top of the image is inserted. The default value is 0.
</font></td></tr></table>
<br /><table border="0">

<tr><td bgcolor="#F0F0F0" style="font-family: monospace;border:1px dotted;color:#808080"><font color="#C00000">Minimum = <em>Value</em></font></td></tr>
</table>
<table style="border:0px none;margin-left:10pt;margin-right:10pt;">
<tr><td><font color="#808080">
<b><em>Value</em></b>: A floating-point value corresponding to the value returned by the <em>Subject</em> in use. The default value is 0.
</font></td></tr></table>
<br /><table border="0">
<tr style="height:16"><td></td></tr>
<tr><td bgcolor="#F0F0F0" style="font-family: monospace;border:1px dotted;color:#808080"><font color="#C00000">Maximum = <em>Value</em></font></td></tr>
</table>
<table style="border:0px none;margin-left:10pt;margin-right:10pt;">
<tr><td><font color="#808080">
<b><em>Value</em></b>: A floating-point value corresponding to the value returned by the <em>Subject</em> in use. The default value is 1000.
</font></td></tr></table>
<br /><table border="0">
<tr style="height:16"><td></td></tr>
<tr><td bgcolor="#F0F0F0" style="font-family: monospace;border:1px dotted;color:#808080"><font color="#C00000">Direction = <em>XDirection</em>, <em>YDirection</em></font></td></tr>
</table>
<table style="border:0px none;margin-left:10pt;margin-right:10pt;">
<tr><td><font color="#808080">
<b><em>XDirection</em></b>: <b>-1:</b> Translates from right to left <b>0:</b> No translation is performed <b>1:</b> Translates from left to right. The default value is 0.<br>
<b><em>YDirection</em></b>: <b>-1:</b> Translates from top to bottom <b>0:</b> No translation is performed <b>1:</b> Translates from bottom to top. The default value is 0.
</font></td></tr></table>

<br /><table border="0">
<tr style="height:16"><td></td></tr>
<tr><td bgcolor="#F0F0F0" style="font-family: monospace;border:1px dotted;color:#808080"><font color="#C00000">Width = <em>NeedleWidth</em></font></td></tr>
</table>
<table style="border:0px none;margin-left:10pt;margin-right:10pt;">
<tr><td><font color="#808080">
<b><em>NeedleWidth</em></b>: An integer which defines the width in pixels of the needle, from the edge of the texture- Translation of the texture will stop when this reaches this number of pixels from the end, in order to avoid wrapping around. The default value is 0.
</font></td></tr></table>

<br /><table border="0">
<tr style="height:16"><td></td></tr>
<tr><td bgcolor="#F0F0F0" style="font-family: monospace;border:1px dotted;color:#808080"><font color="#C00000">Layer = <em>LayerIndex</em></font></td></tr>
Expand All @@ -577,7 +658,7 @@
</font></td></tr></table>
<br /><a name="timetable" />
<br /><table><tr style="height: 4px;"><td /></tr></table>
<font size="+1" color="#0080FF">8. The Timetable section</font><hr />
<font size="+1" color="#0080FF">9. The Timetable section</font><hr />
<table style="border:0px none;margin-left:10pt;margin-right:10pt;">
<tr><td><font size="-1" color="#808080">

Expand Down Expand Up @@ -633,7 +714,7 @@
</font></td></tr></table>
<br /><a name="subjects" />
<br /><table><tr style="height: 4px;"><td /></tr></table>
<font size="+1" color="#0080FF">9. Available subjects</font><hr />
<font size="+1" color="#0080FF">10. Available subjects</font><hr />
<table style="border:0px none;margin-left:10pt;margin-right:10pt;">
<tr><td><font size="-1" color="#808080">

Expand Down
Binary file added Documentation/Images/texturecoords.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 6 additions & 1 deletion RouteViewer/InterfaceR.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,12 @@ internal struct Message {
Value = 3600.0 * (double)h + 60.0 * (double)m;
return true;
}
} else if (n == 3 | n == 4) {
} else if (n >= 3) {
if (n > 4)
{
Interface.AddMessage(Interface.MessageType.Warning, false, "A maximum of 4 digits of precision are supported in TIME values");
n = 4;
}
uint m; if (uint.TryParse(Expression.Substring(i + 1, 2), NumberStyles.None, Culture, out m)) {
uint s; if (uint.TryParse(Expression.Substring(i + 3, n - 2), NumberStyles.None, Culture, out s)) {
Value = 3600.0 * (double)h + 60.0 * (double)m + (double)s;
Expand Down

0 comments on commit bf829f0

Please sign in to comment.