Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions OpenBVE.sln
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RouteViewer", "source\Route
ProjectSection(ProjectDependencies) = postProject
{06D89847-9C7A-47D5-8C7A-95AEBFFF5F1E} = {06D89847-9C7A-47D5-8C7A-95AEBFFF5F1E}
{081F5739-33DA-421A-B177-7B548D96646F} = {081F5739-33DA-421A-B177-7B548D96646F}
{3655732E-5A4F-4D88-B7C0-25BC3043BF8E} = {3655732E-5A4F-4D88-B7C0-25BC3043BF8E}
{4B775819-3574-443E-95AD-B40BC6EA6469} = {4B775819-3574-443E-95AD-B40BC6EA6469}
{67418D38-1E2E-4944-A1B0-09E00FC2D055} = {67418D38-1E2E-4944-A1B0-09E00FC2D055}
{678031C7-6D87-4F5F-9C4A-12F86B76342C} = {678031C7-6D87-4F5F-9C4A-12F86B76342C}
Expand Down Expand Up @@ -187,6 +188,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KatoInput", "source\InputDe
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ZuikiInput", "source\InputDevicePlugins\ZuikiInput\ZuikiInput.csproj", "{73974327-132E-45CC-A278-7030DADB6242}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Route.LokSim", "source\Plugins\Route.Loksim\Route.LokSim.csproj", "{3655732E-5A4F-4D88-B7C0-25BC3043BF8E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -956,6 +959,24 @@ Global
{73974327-132E-45CC-A278-7030DADB6242}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{73974327-132E-45CC-A278-7030DADB6242}.Release|x86.ActiveCfg = Release|Any CPU
{73974327-132E-45CC-A278-7030DADB6242}.Release|x86.Build.0 = Release|Any CPU
{3655732E-5A4F-4D88-B7C0-25BC3043BF8E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3655732E-5A4F-4D88-B7C0-25BC3043BF8E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3655732E-5A4F-4D88-B7C0-25BC3043BF8E}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{3655732E-5A4F-4D88-B7C0-25BC3043BF8E}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{3655732E-5A4F-4D88-B7C0-25BC3043BF8E}.Debug|x86.ActiveCfg = Debug|Any CPU
{3655732E-5A4F-4D88-B7C0-25BC3043BF8E}.Debug|x86.Build.0 = Debug|Any CPU
{3655732E-5A4F-4D88-B7C0-25BC3043BF8E}.GLMenu|Any CPU.ActiveCfg = Debug|Any CPU
{3655732E-5A4F-4D88-B7C0-25BC3043BF8E}.GLMenu|Any CPU.Build.0 = Debug|Any CPU
{3655732E-5A4F-4D88-B7C0-25BC3043BF8E}.GLMenu|Mixed Platforms.ActiveCfg = Debug|Any CPU
{3655732E-5A4F-4D88-B7C0-25BC3043BF8E}.GLMenu|Mixed Platforms.Build.0 = Debug|Any CPU
{3655732E-5A4F-4D88-B7C0-25BC3043BF8E}.GLMenu|x86.ActiveCfg = Debug|Any CPU
{3655732E-5A4F-4D88-B7C0-25BC3043BF8E}.GLMenu|x86.Build.0 = Debug|Any CPU
{3655732E-5A4F-4D88-B7C0-25BC3043BF8E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3655732E-5A4F-4D88-B7C0-25BC3043BF8E}.Release|Any CPU.Build.0 = Release|Any CPU
{3655732E-5A4F-4D88-B7C0-25BC3043BF8E}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{3655732E-5A4F-4D88-B7C0-25BC3043BF8E}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{3655732E-5A4F-4D88-B7C0-25BC3043BF8E}.Release|x86.ActiveCfg = Release|Any CPU
{3655732E-5A4F-4D88-B7C0-25BC3043BF8E}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -995,6 +1016,7 @@ Global
{C4BE7A1F-9CCD-4E78-8341-741ABDA8E026} = {D75531B7-000E-432E-A168-51846256A9D1}
{7ED7B285-FAE6-4B34-ACC5-87399F27C8BC} = {16553295-E70F-4596-AA78-848EEA576C4A}
{BA9949E2-47BE-4308-AD66-1314853FDC49} = {851ADF1E-4500-4A14-B4AA-C1087A6C537E}
{3655732E-5A4F-4D88-B7C0-25BC3043BF8E} = {D75531B7-000E-432E-A168-51846256A9D1}
{73974327-132E-45CC-A278-7030DADB6242} = {851ADF1E-4500-4A14-B4AA-C1087A6C537E}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
Expand Down
2 changes: 1 addition & 1 deletion source/LibRender2/Objects/ObjectLibrary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ private void RemoveObject(ObjectState state)
{
lock (LockObject)
{
if (Objects.TryRemove(state, out _))
if (state != null && Objects.TryRemove(state, out _))
{
myOpaqueFaces.RemoveAll(x => x.Object == state);
myAlphaFaces.RemoveAll(x => x.Object == state);
Expand Down
21 changes: 21 additions & 0 deletions source/OpenBVE/UserInterface/formMain.Start.cs
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,27 @@ private void PopulateRouteList(string routeFolder, ListView listView, bool packa
}
}
break;
case ".l3dfpl":
fileName = System.IO.Path.GetFileName(Files[i]);
if (fileName == null)
{
continue;
}

if (!Program.CurrentHost.LoadPlugins(Program.FileSystem, Interface.CurrentOptions, out _, Program.TrainManager, Program.Renderer))
{
throw new Exception("Unable to load the required plugins- Please reinstall OpenBVE");
}
for (int j = 0; j < Program.CurrentHost.Plugins.Length; j++)
{
if (Program.CurrentHost.Plugins[j].Route != null && Program.CurrentHost.Plugins[j].Route.CanLoadRoute(Files[i]))
{
Item = listView.Items.Add(fileName);
Item.ImageKey = @"loksim";
Item.Tag = Files[i];
}
}
break;
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion source/OpenBveApi/Objects/Helpers/MeshBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ public void Apply(ref StaticObject Object, bool EnableHacks = false, bool Ignore
if (Materials[i].TransparencyTexture != null)
{
currentHost.LoadTexture(Materials[i].TransparencyTexture, new TextureParameters(null, null), out transparency);
currentHost.LoadTexture(ref transparency, OpenGlTextureWrapMode.ClampClamp);
// FIXME: CRASHES SOMETIMES
//currentHost.LoadTexture(ref transparency, OpenGlTextureWrapMode.ClampClamp);
}

TextureParameters parameters;
Expand Down
4 changes: 4 additions & 0 deletions source/OpenBveApi/Routes/QuadTree/QuadNode.Leaf.cs
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,10 @@ internal void UpdateBoundingRectangle(ObjectState objectState, Vector3 quadPosit
Vector3 absolutePosition = quadCenter + quadPosition;
for (int i = 0; i < objectState.Prototype.Mesh.Vertices.Length; i++)
{
if (objectState.Prototype.Mesh.Vertices[i] == null)
{
return;
}
Vector3 vector = absolutePosition + Vector3.Rotate(objectState.Prototype.Mesh.Vertices[i].Coordinates, quadOrientation);
if (vector.X < BoundingRectangle.Left)
{
Expand Down
1 change: 1 addition & 0 deletions source/OpenBveApi/System/Path.Loksim3D.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public static class Loksim3D
/// <returns></returns>
public static string CombineFile(string absolute, string relative, string packageDirectory)
{
relative = relative.TrimStart('\\');
try
{
string file = Path.CombineFile(absolute, relative);
Expand Down
28 changes: 28 additions & 0 deletions source/Plugins/Route.Loksim/Common/Node.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
namespace LokSimRouteParser
{
internal enum LoksimNode
{
// Common
Props,
Random,
// Fahrplan
PneuBremse,
MgBremse,
Haltestellen,
// Kursbuchstrecken
Strecken,
Verbindung,
StartPunkt,
// Objecte
Objecte,
Object,
Eintrag,
Eigenschaften,
Lightning,
// L3DRail
Hoehe,
TexSchieneOben,
TexSchieneSeite,
TexBettung
}
}
65 changes: 65 additions & 0 deletions source/Plugins/Route.Loksim/Common/PropsAttribute.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
namespace LokSimRouteParser
{
internal enum PropsAttribute
{
// Common attributes
FileAuthor,
FileInfo,
FilePicture,
FileDoku,
Name,
// Kurbuchstrecken only
KBS,
BremsArt,
BremsStellung,
WetterDatei,
Zeiten,
ZugArt,
ZugGewicht,
ZugLaenge,
ZugLimit,
// StartPunkt only
Gleis,
Pos,
Richtung,
Strecke,
// Station only
Abfahrt,
Ankunft,
Bedarfshalt,
Betriebshalt,
Haltdauer,
Haltepunkt,
DistanzSoundVorBedarfsHalt,
DistanzSoundVorHalt,
SignalVorAusfahrt,
SignalVorEinfahrt,
SoundAbfahrt,
SoundAnkunft,
SoundAnsage,
SoundHalt,
SoundVorBedarfsHalt,
SoundVorHalt,
Tueren,
Zugfolgestelle,
// Connection
Ende1,
Ende2,
Gleis1,
Gleis2,
Strecke1,
Strecke2,
// Eintrag
Abstand,
Anzahl,
Datei,
GleisHoeheFolgen,
HoeheLand,
Position,
Verschiebung,
WeitSichtbar,
Winkel,


}
}
Loading