Skip to content

Commit f5b2085

Browse files
authored
Merge pull request #567 from cjakeman/64-bit
Adds 64-bit compatibility
2 parents 0880b10 + c56d0d4 commit f5b2085

File tree

41 files changed

+437
-469
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+437
-469
lines changed

Build.cmd

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ CALL :list-or-check-tool "MSBuild.exe" "[UTS] Microsoft Visual Studio build tool
3232
CALL :list-or-check-tool "lazbuild.exe" "[UTS] Lazarus compiler"
3333
CALL :list-or-check-tool "strip.exe" "[UTS] Lazarus tool"
3434
CALL :list-or-check-tool "xunit.console.x86.exe" "[UTS] XUnit tool"
35-
CALL :list-or-check-tool "editbin.exe" "[UTS] Microsoft Visual Studio editbin tool"
3635
CALL :list-or-check-tool "rcedit-x86.exe" "[UTS] Electron rcedit tool"
3736
CALL :list-or-check-tool "7za.exe" "[UTS] 7-zip tool"
3837
CALL :list-or-check-tool "OfficeToPDF.exe" "[TS] Office-to-PDF conversion tool"
@@ -109,11 +108,6 @@ REM Run unit tests (9009 means XUnit itself wasn't found, which is an error).
109108
xunit.console.x86 Program\Tests.dll -nunit xunit.xml
110109
IF "%ERRORLEVEL%" == "9009" GOTO :error
111110

112-
CALL :copy "Program\RunActivity.exe" "Program\RunActivityLAA.exe" || GOTO :error
113-
editbin /NOLOGO /LARGEADDRESSAWARE "Program\RunActivityLAA.exe" || GOTO :error
114-
CALL :copy "Program\RunActivity.exe.config" "Program\RunActivityLAA.exe.config" || GOTO :error
115-
ECHO Created large address aware version of RunActivity.exe.
116-
117111
REM Copy the web content
118112
ROBOCOPY /MIR /NJH /NJS "Source\RunActivity\Viewer3D\WebServices\Web" "Program\Content\Web"
119113
IF %ERRORLEVEL% GEQ 8 GOTO :error

Source/ContentChecker/ContentChecker.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,23 @@
1313
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
1414
<TargetFrameworkProfile />
1515
</PropertyGroup>
16-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
16+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
1717
<DebugSymbols>true</DebugSymbols>
1818
<OutputPath>..\..\Program\</OutputPath>
1919
<DefineConstants>DEBUG;TRACE</DefineConstants>
2020
<DebugType>full</DebugType>
21-
<PlatformTarget>x86</PlatformTarget>
21+
<PlatformTarget>AnyCPU</PlatformTarget>
2222
<ErrorReport>prompt</ErrorReport>
2323
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
2424
<Prefer32Bit>false</Prefer32Bit>
2525
<LangVersion>7.3</LangVersion>
2626
</PropertyGroup>
27-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
27+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
2828
<OutputPath>..\..\Program\</OutputPath>
2929
<DefineConstants>TRACE</DefineConstants>
3030
<Optimize>true</Optimize>
3131
<DebugType>pdbonly</DebugType>
32-
<PlatformTarget>x86</PlatformTarget>
32+
<PlatformTarget>AnyCPU</PlatformTarget>
3333
<ErrorReport>prompt</ErrorReport>
3434
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
3535
<Prefer32Bit>false</Prefer32Bit>

Source/Contrib/ActivityEditor/AEWizard/AEWizard.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
44
<PropertyGroup>
55
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6-
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
77
<ProjectGuid>{79EFFB38-252C-4B06-BD4E-7C7FDE0A20DC}</ProjectGuid>
88
<OutputType>Library</OutputType>
99
<AppDesignerFolder>Properties</AppDesignerFolder>
@@ -13,26 +13,26 @@
1313
<FileAlignment>512</FileAlignment>
1414
<TargetFrameworkProfile />
1515
</PropertyGroup>
16-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
16+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
1717
<DebugSymbols>true</DebugSymbols>
1818
<DebugType>full</DebugType>
1919
<Optimize>false</Optimize>
2020
<OutputPath>..\..\..\..\Program\</OutputPath>
2121
<DefineConstants>DEBUG;TRACE</DefineConstants>
2222
<ErrorReport>prompt</ErrorReport>
2323
<WarningLevel>4</WarningLevel>
24-
<PlatformTarget>x86</PlatformTarget>
24+
<PlatformTarget>AnyCPU</PlatformTarget>
2525
<Prefer32Bit>false</Prefer32Bit>
2626
<LangVersion>7.3</LangVersion>
2727
</PropertyGroup>
28-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
28+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
2929
<DebugType>pdbonly</DebugType>
3030
<Optimize>true</Optimize>
3131
<OutputPath>..\..\..\..\Program\</OutputPath>
3232
<DefineConstants>TRACE</DefineConstants>
3333
<ErrorReport>prompt</ErrorReport>
3434
<WarningLevel>4</WarningLevel>
35-
<PlatformTarget>x86</PlatformTarget>
35+
<PlatformTarget>AnyCPU</PlatformTarget>
3636
<Prefer32Bit>false</Prefer32Bit>
3737
<LangVersion>7.3</LangVersion>
3838
</PropertyGroup>

Source/Contrib/ActivityEditor/ActivityEditor/ActivityEditor.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
44
<PropertyGroup>
55
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6-
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
77
<ProjectGuid>{306C904F-BE41-4B39-A0C4-51068B7F205E}</ProjectGuid>
88
<OutputType>WinExe</OutputType>
99
<AppDesignerFolder>Properties</AppDesignerFolder>
@@ -14,26 +14,26 @@
1414
<ApplicationIcon>..\..\..\ORTS.ico</ApplicationIcon>
1515
<TargetFrameworkProfile />
1616
</PropertyGroup>
17-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
17+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
1818
<DebugSymbols>true</DebugSymbols>
1919
<DebugType>full</DebugType>
2020
<Optimize>false</Optimize>
2121
<OutputPath>..\..\..\..\Program\</OutputPath>
2222
<DefineConstants>TRACE;DEBUG;WINDOWS;ACTIVITY_EDITOR</DefineConstants>
2323
<ErrorReport>prompt</ErrorReport>
2424
<WarningLevel>4</WarningLevel>
25-
<PlatformTarget>x86</PlatformTarget>
25+
<PlatformTarget>AnyCPU</PlatformTarget>
2626
<Prefer32Bit>false</Prefer32Bit>
2727
<LangVersion>7.3</LangVersion>
2828
</PropertyGroup>
29-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
29+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
3030
<DebugType>pdbonly</DebugType>
3131
<Optimize>true</Optimize>
3232
<OutputPath>..\..\..\..\Program\</OutputPath>
3333
<DefineConstants>TRACE;WINDOWS;ACTIVITY_EDITOR</DefineConstants>
3434
<ErrorReport>prompt</ErrorReport>
3535
<WarningLevel>4</WarningLevel>
36-
<PlatformTarget>x86</PlatformTarget>
36+
<PlatformTarget>AnyCPU</PlatformTarget>
3737
<Prefer32Bit>false</Prefer32Bit>
3838
<LangVersion>7.3</LangVersion>
3939
</PropertyGroup>

Source/Contrib/ActivityEditor/LibAE/LibAE.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
44
<PropertyGroup>
55
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6-
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
77
<ProjectGuid>{B79691A7-BF8C-40B4-ADE0-5F30F2730414}</ProjectGuid>
88
<OutputType>Library</OutputType>
99
<AppDesignerFolder>Properties</AppDesignerFolder>
@@ -13,26 +13,26 @@
1313
<FileAlignment>512</FileAlignment>
1414
<TargetFrameworkProfile />
1515
</PropertyGroup>
16-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
16+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
1717
<DebugSymbols>true</DebugSymbols>
1818
<DebugType>full</DebugType>
1919
<Optimize>false</Optimize>
2020
<OutputPath>..\..\..\..\Program\</OutputPath>
2121
<DefineConstants>TRACE;DEBUG;WINDOWS;ACTIVITY_EDITOR;JSON_OR_XML</DefineConstants>
2222
<ErrorReport>prompt</ErrorReport>
2323
<WarningLevel>4</WarningLevel>
24-
<PlatformTarget>x86</PlatformTarget>
24+
<PlatformTarget>AnyCPU</PlatformTarget>
2525
<Prefer32Bit>false</Prefer32Bit>
2626
<LangVersion>7.3</LangVersion>
2727
</PropertyGroup>
28-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
28+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
2929
<DebugType>pdbonly</DebugType>
3030
<Optimize>true</Optimize>
3131
<OutputPath>..\..\..\..\Program\</OutputPath>
3232
<DefineConstants>TRACE;WINDOWS;ACTIVITY_EDITOR</DefineConstants>
3333
<ErrorReport>prompt</ErrorReport>
3434
<WarningLevel>4</WarningLevel>
35-
<PlatformTarget>x86</PlatformTarget>
35+
<PlatformTarget>AnyCPU</PlatformTarget>
3636
<Prefer32Bit>false</Prefer32Bit>
3737
<LangVersion>7.3</LangVersion>
3838
</PropertyGroup>

Source/Contrib/ContentManager/ContentManager.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
44
<PropertyGroup>
55
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6-
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
77
<ProjectGuid>{E3E04859-2734-46EA-99B6-8A9721E85D3F}</ProjectGuid>
88
<OutputType>WinExe</OutputType>
99
<AppDesignerFolder>Properties</AppDesignerFolder>
@@ -14,26 +14,26 @@
1414
<ApplicationIcon>..\..\ORTS.ico</ApplicationIcon>
1515
<TargetFrameworkProfile />
1616
</PropertyGroup>
17-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
17+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
1818
<DebugSymbols>true</DebugSymbols>
1919
<DebugType>full</DebugType>
2020
<Optimize>false</Optimize>
2121
<OutputPath>..\..\..\Program\</OutputPath>
2222
<DefineConstants>DEBUG;TRACE</DefineConstants>
2323
<ErrorReport>prompt</ErrorReport>
2424
<WarningLevel>4</WarningLevel>
25-
<PlatformTarget>x86</PlatformTarget>
25+
<PlatformTarget>AnyCPU</PlatformTarget>
2626
<Prefer32Bit>false</Prefer32Bit>
2727
<LangVersion>7.3</LangVersion>
2828
</PropertyGroup>
29-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
29+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
3030
<DebugType>pdbonly</DebugType>
3131
<Optimize>true</Optimize>
3232
<OutputPath>..\..\..\Program\</OutputPath>
3333
<DefineConstants>TRACE</DefineConstants>
3434
<ErrorReport>prompt</ErrorReport>
3535
<WarningLevel>4</WarningLevel>
36-
<PlatformTarget>x86</PlatformTarget>
36+
<PlatformTarget>AnyCPU</PlatformTarget>
3737
<Prefer32Bit>false</Prefer32Bit>
3838
<LangVersion>7.3</LangVersion>
3939
</PropertyGroup>

Source/Contrib/DataCollector/DataCollector.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
44
<PropertyGroup>
55
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6-
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
77
<ProjectGuid>{22CC0DE5-5E0C-4CA4-9CC0-FF1FE6C6B2BA}</ProjectGuid>
88
<OutputType>Exe</OutputType>
99
<AppDesignerFolder>Properties</AppDesignerFolder>
@@ -13,26 +13,26 @@
1313
<FileAlignment>512</FileAlignment>
1414
<TargetFrameworkProfile />
1515
</PropertyGroup>
16-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
16+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
1717
<DebugSymbols>true</DebugSymbols>
1818
<DebugType>full</DebugType>
1919
<Optimize>false</Optimize>
2020
<OutputPath>..\..\..\Program\</OutputPath>
2121
<DefineConstants>DEBUG;TRACE</DefineConstants>
2222
<ErrorReport>prompt</ErrorReport>
2323
<WarningLevel>4</WarningLevel>
24-
<PlatformTarget>x86</PlatformTarget>
24+
<PlatformTarget>AnyCPU</PlatformTarget>
2525
<Prefer32Bit>false</Prefer32Bit>
2626
<LangVersion>7.3</LangVersion>
2727
</PropertyGroup>
28-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
28+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
2929
<DebugType>pdbonly</DebugType>
3030
<Optimize>true</Optimize>
3131
<OutputPath>..\..\..\Program\</OutputPath>
3232
<DefineConstants>TRACE</DefineConstants>
3333
<ErrorReport>prompt</ErrorReport>
3434
<WarningLevel>4</WarningLevel>
35-
<PlatformTarget>x86</PlatformTarget>
35+
<PlatformTarget>AnyCPU</PlatformTarget>
3636
<Prefer32Bit>false</Prefer32Bit>
3737
<LangVersion>7.3</LangVersion>
3838
</PropertyGroup>

Source/Contrib/DataConverter/DataConverter.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,23 @@
1717
<PropertyGroup>
1818
<ApplicationIcon>..\..\ORTS.ico</ApplicationIcon>
1919
</PropertyGroup>
20-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
20+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
2121
<DebugSymbols>true</DebugSymbols>
2222
<OutputPath>..\..\..\Program\</OutputPath>
2323
<DefineConstants>DEBUG;TRACE</DefineConstants>
2424
<DebugType>full</DebugType>
25-
<PlatformTarget>x86</PlatformTarget>
25+
<PlatformTarget>AnyCPU</PlatformTarget>
2626
<ErrorReport>prompt</ErrorReport>
2727
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
2828
<Prefer32Bit>false</Prefer32Bit>
2929
<LangVersion>7.3</LangVersion>
3030
</PropertyGroup>
31-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
31+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
3232
<OutputPath>..\..\..\Program\</OutputPath>
3333
<DefineConstants>TRACE</DefineConstants>
3434
<Optimize>true</Optimize>
3535
<DebugType>pdbonly</DebugType>
36-
<PlatformTarget>x86</PlatformTarget>
36+
<PlatformTarget>AnyCPU</PlatformTarget>
3737
<ErrorReport>prompt</ErrorReport>
3838
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
3939
<Prefer32Bit>false</Prefer32Bit>

Source/Contrib/DataValidator/DataValidator.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,23 @@
1313
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
1414
<TargetFrameworkProfile />
1515
</PropertyGroup>
16-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
16+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
1717
<DebugSymbols>true</DebugSymbols>
1818
<OutputPath>..\..\..\Program\</OutputPath>
1919
<DefineConstants>DEBUG;TRACE</DefineConstants>
2020
<DebugType>full</DebugType>
21-
<PlatformTarget>x86</PlatformTarget>
21+
<PlatformTarget>AnyCPU</PlatformTarget>
2222
<ErrorReport>prompt</ErrorReport>
2323
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
2424
<Prefer32Bit>false</Prefer32Bit>
2525
<LangVersion>7.3</LangVersion>
2626
</PropertyGroup>
27-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
27+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
2828
<OutputPath>..\..\..\Program\</OutputPath>
2929
<DefineConstants>TRACE</DefineConstants>
3030
<Optimize>true</Optimize>
3131
<DebugType>pdbonly</DebugType>
32-
<PlatformTarget>x86</PlatformTarget>
32+
<PlatformTarget>AnyCPU</PlatformTarget>
3333
<ErrorReport>prompt</ErrorReport>
3434
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
3535
<Prefer32Bit>false</Prefer32Bit>

Source/Contrib/TrackViewer/Drawing/CloseToMouse.cs

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -62,22 +62,6 @@ public bool IsCloserThan(CloseToMouse otherItem)
6262
return this.ClosestMouseDistanceSquared < otherItem.ClosestMouseDistanceSquared;
6363
}
6464

65-
/// <summary>
66-
/// get distance between two world locations not taking the height in account
67-
/// </summary>
68-
/// <param name="location1">first location</param>
69-
/// <param name="location2">second location</param>
70-
/// <returns>Distance squared</returns>
71-
/// <remarks>Very similar to WordlLocation.GetDistanceSquared</remarks>
72-
public static float GetGroundDistanceSquared(WorldLocation location1, WorldLocation location2)
73-
{
74-
float dx = location1.Location.X - location2.Location.X;
75-
float dz = location1.Location.Z - location2.Location.Z;
76-
dx += 2048 * (location1.TileX - location2.TileX);
77-
dz += 2048 * (location1.TileZ - location2.TileZ);
78-
return dx * dx + dz * dz;
79-
}
80-
8165
}
8266

8367
/// <summary>
@@ -144,7 +128,7 @@ public CloseToMouseJunctionOrEnd(TrackNode junctionOrEndNode, string description
144128
/// <param name="description">The type of item (needed for later printing in statusbar)</param>
145129
public void CheckMouseDistance(WorldLocation location, WorldLocation mouseLocation, TrackNode junctionOrEndNode, string description)
146130
{
147-
float distanceSquared = CloseToMouse.GetGroundDistanceSquared(location, mouseLocation);
131+
float distanceSquared = WorldLocation.GetDistanceSquared2D(location, mouseLocation);
148132
if (distanceSquared < ClosestDistanceSquared)
149133
{
150134
ClosestDistanceSquared = distanceSquared;
@@ -210,7 +194,7 @@ public override void Reset()
210194
/// <param name="trItem">The track Item that will be stored when it is indeed the closest</param>
211195
public void CheckMouseDistance(WorldLocation location, WorldLocation mouseLocation, DrawableTrackItem trItem)
212196
{
213-
float distanceSquared = CloseToMouse.GetGroundDistanceSquared(location, mouseLocation);
197+
float distanceSquared = WorldLocation.GetDistanceSquared2D(location, mouseLocation);
214198

215199
if (distanceSquared < ClosestDistanceSquared)
216200
{
@@ -317,7 +301,7 @@ public void CheckMouseDistance(WorldLocation location, WorldLocation mouseLocati
317301
TrackNode trackNode, TrVectorSection vectorSection, int tvsi, double pixelsPerMeter)
318302
{
319303
storedMouseLocation = mouseLocation;
320-
float distanceSquared = CloseToMouse.GetGroundDistanceSquared(location, mouseLocation);
304+
float distanceSquared = WorldLocation.GetDistanceSquared2D(location, mouseLocation);
321305
// to make unique distances becasue they also act as Key
322306
double distanceSquaredIndexed = ((double)distanceSquared) * (1 + 1e-16 * trackNode.Index);
323307
if (distanceSquaredIndexed < sortedTrackCandidates.First().Key)
@@ -386,8 +370,8 @@ DistanceLon CalcRealDistanceSquared(TrVectorSection trackVectorSection, TrackSec
386370
X = storedMouseLocation.Location.X - trackVectorSection.X,
387371
Z = storedMouseLocation.Location.Z - trackVectorSection.Z
388372
};
389-
vectorToMouse.X += (storedMouseLocation.TileX - trackVectorSection.TileX) * 2048;
390-
vectorToMouse.Z += (storedMouseLocation.TileZ - trackVectorSection.TileZ) * 2048;
373+
vectorToMouse.X = (float)(vectorToMouse.X + (storedMouseLocation.TileX - trackVectorSection.TileX) * WorldLocation.TileSize);
374+
vectorToMouse.Z = (float)(vectorToMouse.Z + (storedMouseLocation.TileZ - trackVectorSection.TileZ) * WorldLocation.TileSize);
391375

392376
//Now rotate the vector such that a direction along the track is in a direction (x=0, z=1)
393377
vectorToMouse = Vector3.Transform(vectorToMouse, Matrix.CreateRotationY(-trackVectorSection.AY));

0 commit comments

Comments
 (0)