Commit 077ba676 authored by s520's avatar s520 Committed by Christopher Lees

New: Add Obj file parser using Assimp (#297)

* Fix: OpenBVE.sln

* New: Add Obj file parser using Assimp

* Fix: OpenBVE.sln

* Fix: the copyright notice of Assimp Obj parser

* Change: combine the two Assimp DLLs into one
parent 77d96023
...@@ -58,7 +58,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DefaultDisplayPlugin", "sou ...@@ -58,7 +58,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DefaultDisplayPlugin", "sou
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Texture.Tga", "source\Plugins\Texture.Tga\Texture.Tga.csproj", "{F714A9FA-1C4B-456B-BACF-D6763223A81C}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Texture.Tga", "source\Plugins\Texture.Tga\Texture.Tga.csproj", "{F714A9FA-1C4B-456B-BACF-D6763223A81C}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AssimpXParser", "source\AssimpXParser\AssimpXParser.csproj", "{572CD7FF-A0C9-4A48-81B7-79B65E37D3C7}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AssimpParser", "source\AssimpParser\AssimpParser.csproj", "{77CCAE62-D374-468E-98A0-DD8ADB461C10}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
...@@ -297,6 +297,7 @@ Global ...@@ -297,6 +297,7 @@ Global
{3D833D81-4F14-4A68-B0DE-6469B8CF4E62}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {3D833D81-4F14-4A68-B0DE-6469B8CF4E62}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{3D833D81-4F14-4A68-B0DE-6469B8CF4E62}.Release|Mixed Platforms.Build.0 = Release|Any CPU {3D833D81-4F14-4A68-B0DE-6469B8CF4E62}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{3D833D81-4F14-4A68-B0DE-6469B8CF4E62}.Release|x86.ActiveCfg = Release|Any CPU {3D833D81-4F14-4A68-B0DE-6469B8CF4E62}.Release|x86.ActiveCfg = Release|Any CPU
{3D833D81-4F14-4A68-B0DE-6469B8CF4E62}.Release|x86.Build.0 = Release|Any CPU
{F714A9FA-1C4B-456B-BACF-D6763223A81C}.Debug|Any CPU.ActiveCfg = Debug|x86 {F714A9FA-1C4B-456B-BACF-D6763223A81C}.Debug|Any CPU.ActiveCfg = Debug|x86
{F714A9FA-1C4B-456B-BACF-D6763223A81C}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 {F714A9FA-1C4B-456B-BACF-D6763223A81C}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
{F714A9FA-1C4B-456B-BACF-D6763223A81C}.Debug|Mixed Platforms.Build.0 = Debug|x86 {F714A9FA-1C4B-456B-BACF-D6763223A81C}.Debug|Mixed Platforms.Build.0 = Debug|x86
...@@ -307,18 +308,18 @@ Global ...@@ -307,18 +308,18 @@ Global
{F714A9FA-1C4B-456B-BACF-D6763223A81C}.Release|Mixed Platforms.Build.0 = Release|x86 {F714A9FA-1C4B-456B-BACF-D6763223A81C}.Release|Mixed Platforms.Build.0 = Release|x86
{F714A9FA-1C4B-456B-BACF-D6763223A81C}.Release|x86.ActiveCfg = Release|x86 {F714A9FA-1C4B-456B-BACF-D6763223A81C}.Release|x86.ActiveCfg = Release|x86
{F714A9FA-1C4B-456B-BACF-D6763223A81C}.Release|x86.Build.0 = Release|x86 {F714A9FA-1C4B-456B-BACF-D6763223A81C}.Release|x86.Build.0 = Release|x86
{572CD7FF-A0C9-4A48-81B7-79B65E37D3C7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {77CCAE62-D374-468E-98A0-DD8ADB461C10}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{572CD7FF-A0C9-4A48-81B7-79B65E37D3C7}.Debug|Any CPU.Build.0 = Debug|Any CPU {77CCAE62-D374-468E-98A0-DD8ADB461C10}.Debug|Any CPU.Build.0 = Debug|Any CPU
{572CD7FF-A0C9-4A48-81B7-79B65E37D3C7}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU {77CCAE62-D374-468E-98A0-DD8ADB461C10}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{572CD7FF-A0C9-4A48-81B7-79B65E37D3C7}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU {77CCAE62-D374-468E-98A0-DD8ADB461C10}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{572CD7FF-A0C9-4A48-81B7-79B65E37D3C7}.Debug|x86.ActiveCfg = Debug|Any CPU {77CCAE62-D374-468E-98A0-DD8ADB461C10}.Debug|x86.ActiveCfg = Debug|Any CPU
{572CD7FF-A0C9-4A48-81B7-79B65E37D3C7}.Debug|x86.Build.0 = Debug|Any CPU {77CCAE62-D374-468E-98A0-DD8ADB461C10}.Debug|x86.Build.0 = Debug|Any CPU
{572CD7FF-A0C9-4A48-81B7-79B65E37D3C7}.Release|Any CPU.ActiveCfg = Release|Any CPU {77CCAE62-D374-468E-98A0-DD8ADB461C10}.Release|Any CPU.ActiveCfg = Release|Any CPU
{572CD7FF-A0C9-4A48-81B7-79B65E37D3C7}.Release|Any CPU.Build.0 = Release|Any CPU {77CCAE62-D374-468E-98A0-DD8ADB461C10}.Release|Any CPU.Build.0 = Release|Any CPU
{572CD7FF-A0C9-4A48-81B7-79B65E37D3C7}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {77CCAE62-D374-468E-98A0-DD8ADB461C10}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{572CD7FF-A0C9-4A48-81B7-79B65E37D3C7}.Release|Mixed Platforms.Build.0 = Release|Any CPU {77CCAE62-D374-468E-98A0-DD8ADB461C10}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{572CD7FF-A0C9-4A48-81B7-79B65E37D3C7}.Release|x86.ActiveCfg = Release|Any CPU {77CCAE62-D374-468E-98A0-DD8ADB461C10}.Release|x86.ActiveCfg = Release|Any CPU
{572CD7FF-A0C9-4A48-81B7-79B65E37D3C7}.Release|x86.Build.0 = Release|Any CPU {77CCAE62-D374-468E-98A0-DD8ADB461C10}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
...@@ -332,9 +333,11 @@ Global ...@@ -332,9 +333,11 @@ Global
{E9B64673-65B7-4D77-A4DB-4B441A7C9197} = {3D6660F8-52D2-4A30-8F1E-1922DDCF10F9} {E9B64673-65B7-4D77-A4DB-4B441A7C9197} = {3D6660F8-52D2-4A30-8F1E-1922DDCF10F9}
{EEC75E83-E284-44E0-B321-3F5C6512074F} = {16553295-E70F-4596-AA78-848EEA576C4A} {EEC75E83-E284-44E0-B321-3F5C6512074F} = {16553295-E70F-4596-AA78-848EEA576C4A}
{E81B7BD8-A326-47D3-B7EE-E9C7D4D119FA} = {16553295-E70F-4596-AA78-848EEA576C4A} {E81B7BD8-A326-47D3-B7EE-E9C7D4D119FA} = {16553295-E70F-4596-AA78-848EEA576C4A}
{B8955CA6-E002-48A6-8FBF-90C2084C3508} = {16553295-E70F-4596-AA78-848EEA576C4A}
{A2FC4D71-1ED9-40D4-B746-FE6AB3C7D55E} = {16553295-E70F-4596-AA78-848EEA576C4A} {A2FC4D71-1ED9-40D4-B746-FE6AB3C7D55E} = {16553295-E70F-4596-AA78-848EEA576C4A}
{0C73C749-FCAE-4254-A614-AE1B03AF45C9} = {851ADF1E-4500-4A14-B4AA-C1087A6C537E} {0C73C749-FCAE-4254-A614-AE1B03AF45C9} = {851ADF1E-4500-4A14-B4AA-C1087A6C537E}
{3D833D81-4F14-4A68-B0DE-6469B8CF4E62} = {851ADF1E-4500-4A14-B4AA-C1087A6C537E} {3D833D81-4F14-4A68-B0DE-6469B8CF4E62} = {851ADF1E-4500-4A14-B4AA-C1087A6C537E}
{F714A9FA-1C4B-456B-BACF-D6763223A81C} = {16553295-E70F-4596-AA78-848EEA576C4A}
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {50B52A67-69B1-4B19-A59C-FF058FD9EBDF} SolutionGuid = {50B52A67-69B1-4B19-A59C-FF058FD9EBDF}
......
...@@ -76,8 +76,8 @@ OPEN_BVE_FILE :=OpenBve.exe ...@@ -76,8 +76,8 @@ OPEN_BVE_FILE :=OpenBve.exe
OPEN_BVE_API_ROOT :=source/OpenBveApi OPEN_BVE_API_ROOT :=source/OpenBveApi
OPEN_BVE_API_FILE :=OpenBveApi.dll OPEN_BVE_API_FILE :=OpenBveApi.dll
ASSIMP_X_ROOT :=source/AssimpXParser ASSIMP_ROOT :=source/AssimpParser
ASSIMP_X_FILE :=AssimpXParser.exe ASSIMP_FILE :=AssimpParser.dll
DEFAULT_DISPLAY_ROOT :=source/InputDevicePlugins/DefaultDisplayPlugin DEFAULT_DISPLAY_ROOT :=source/InputDevicePlugins/DefaultDisplayPlugin
DEFAULT_DISPLAY_FILE :=Data/InputDevicePlugins/DefaultDisplayPlugin.dll DEFAULT_DISPLAY_FILE :=Data/InputDevicePlugins/DefaultDisplayPlugin.dll
...@@ -257,7 +257,7 @@ clean: ...@@ -257,7 +257,7 @@ clean:
# DLL # DLL
rm -f bin*/OpenBveApi.dll* bin*/OpenBveApi.pdb rm -f bin*/OpenBveApi.dll* bin*/OpenBveApi.pdb
rm -f bin*/AssimpXParser.dll* bin*/AssimpXParser.pdb rm -f bin*/AssimpParser.dll* bin*/AssimpParser.pdb
rm -f bin*/Data/Formats/Formats.Msts.dll* bin*/Data/Formats/Formats.Msts.pdb rm -f bin*/Data/Formats/Formats.Msts.dll* bin*/Data/Formats/Formats.Msts.pdb
rm -f bin*/Data/Formats/Formats.DirectX.dll* bin*/Data/Formats/Formats.DirectX.pdb rm -f bin*/Data/Formats/Formats.DirectX.dll* bin*/Data/Formats/Formats.DirectX.pdb
rm -f bin*/Data/InputDevicePlugins/DefaultDisplayPlugin.dll* bin*/Data/InputDevicePlugins/DefaultDisplayPlugin.pdb rm -f bin*/Data/InputDevicePlugins/DefaultDisplayPlugin.dll* bin*/Data/InputDevicePlugins/DefaultDisplayPlugin.pdb
...@@ -358,7 +358,7 @@ $(OPEN_BVE_ROOT)/Properties/AssemblyInfo.cs: $(OPEN_BVE_ROOT)/Properties/Assembl ...@@ -358,7 +358,7 @@ $(OPEN_BVE_ROOT)/Properties/AssemblyInfo.cs: $(OPEN_BVE_ROOT)/Properties/Assembl
$(call create_resource, $(OPEN_BVE_RESOURCE), $(OPEN_BVE_RESX)) $(call create_resource, $(OPEN_BVE_RESOURCE), $(OPEN_BVE_RESX))
$(DEBUG_DIR)/$(OPEN_BVE_FILE): $(DEBUG_DIR)/$(OPEN_BVE_API_FILE) $(DEBUG_DIR)/$(OPEN_BVE_FILE): $(DEBUG_DIR)/$(OPEN_BVE_API_FILE)
$(DEBUG_DIR)/$(OPEN_BVE_FILE): $(DEBUG_DIR)/$(ASSIMP_X_FILE) $(DEBUG_DIR)/$(OPEN_BVE_FILE): $(DEBUG_DIR)/$(ASSIMP_FILE)
$(DEBUG_DIR)/$(OPEN_BVE_FILE): $(DEBUG_DIR)/$(DEFAULT_DISPLAY_FILE) $(DEBUG_DIR)/$(OPEN_BVE_FILE): $(DEBUG_DIR)/$(DEFAULT_DISPLAY_FILE)
$(DEBUG_DIR)/$(OPEN_BVE_FILE): $(DEBUG_DIR)/$(SAN_YING_INPUT_FILE) $(DEBUG_DIR)/$(OPEN_BVE_FILE): $(DEBUG_DIR)/$(SAN_YING_INPUT_FILE)
$(DEBUG_DIR)/$(OPEN_BVE_FILE): $(DEBUG_DIR)/$(OPEN_BVE_ATS_FILE) $(DEBUG_DIR)/$(OPEN_BVE_FILE): $(DEBUG_DIR)/$(OPEN_BVE_ATS_FILE)
...@@ -374,7 +374,7 @@ $(DEBUG_DIR)/$(OPEN_BVE_FILE): $(DEBUG_DIR)/$(FORMATS_MSTS_FILE) ...@@ -374,7 +374,7 @@ $(DEBUG_DIR)/$(OPEN_BVE_FILE): $(DEBUG_DIR)/$(FORMATS_MSTS_FILE)
$(DEBUG_DIR)/$(OPEN_BVE_FILE): $(DEBUG_DIR)/$(FORMATS_DIRECTX_FILE) $(DEBUG_DIR)/$(OPEN_BVE_FILE): $(DEBUG_DIR)/$(FORMATS_DIRECTX_FILE)
$(RELEASE_DIR)/$(OPEN_BVE_FILE): $(RELEASE_DIR)/$(OPEN_BVE_API_FILE) $(RELEASE_DIR)/$(OPEN_BVE_FILE): $(RELEASE_DIR)/$(OPEN_BVE_API_FILE)
$(RELEASE_DIR)/$(OPEN_BVE_FILE): $(RELEASE_DIR)/$(ASSIMP_X_FILE) $(RELEASE_DIR)/$(OPEN_BVE_FILE): $(RELEASE_DIR)/$(ASSIMP_FILE)
$(RELEASE_DIR)/$(OPEN_BVE_FILE): $(RELEASE_DIR)/$(DEFAULT_DISPLAY_FILE) $(RELEASE_DIR)/$(OPEN_BVE_FILE): $(RELEASE_DIR)/$(DEFAULT_DISPLAY_FILE)
$(RELEASE_DIR)/$(OPEN_BVE_FILE): $(RELEASE_DIR)/$(SAN_YING_INPUT_FILE) $(RELEASE_DIR)/$(OPEN_BVE_FILE): $(RELEASE_DIR)/$(SAN_YING_INPUT_FILE)
$(RELEASE_DIR)/$(OPEN_BVE_FILE): $(RELEASE_DIR)/$(OPEN_BVE_ATS_FILE) $(RELEASE_DIR)/$(OPEN_BVE_FILE): $(RELEASE_DIR)/$(OPEN_BVE_ATS_FILE)
...@@ -393,7 +393,7 @@ $(DEBUG_DIR)/$(OPEN_BVE_FILE) $(RELEASE_DIR)/$(OPEN_BVE_FILE): $(OPEN_BVE_ROOT)/ ...@@ -393,7 +393,7 @@ $(DEBUG_DIR)/$(OPEN_BVE_FILE) $(RELEASE_DIR)/$(OPEN_BVE_FILE): $(OPEN_BVE_ROOT)/
@echo $(COLOR_MAGENTA)Building $(COLOR_CYAN)$(OPEN_BVE_OUT)$(COLOR_END) @echo $(COLOR_MAGENTA)Building $(COLOR_CYAN)$(OPEN_BVE_OUT)$(COLOR_END)
@$(CSC) /out:$(OPEN_BVE_OUT) /target:winexe /main:OpenBve.Program $(OPEN_BVE_SRC) $(ARGS) $(OPEN_BVE_DOC) \ @$(CSC) /out:$(OPEN_BVE_OUT) /target:winexe /main:OpenBve.Program $(OPEN_BVE_SRC) $(ARGS) $(OPEN_BVE_DOC) \
$(OPEN_BVE_ROOT)/Properties/AssemblyInfo.cs \ $(OPEN_BVE_ROOT)/Properties/AssemblyInfo.cs \
/reference:$(OUTPUT_DIR)/OpenTK.dll /reference:$(OPEN_BVE_API_OUT) /reference:$(ASSIMP_X_OUT) /reference:$(FORMATS_MSTS_OUT) /reference:$(FORMATS_DIRECTX_OUT) \ /reference:$(OUTPUT_DIR)/OpenTK.dll /reference:$(OPEN_BVE_API_OUT) /reference:$(ASSIMP_OUT) /reference:$(FORMATS_MSTS_OUT) /reference:$(FORMATS_DIRECTX_OUT) \
/reference:$(OUTPUT_DIR)/CSScriptLibrary.dll /reference:$(OUTPUT_DIR)/NUniversalCharDet.dll /reference:$(OUTPUT_DIR)/SharpCompress.dll /reference:$(OUTPUT_DIR)/PIEHid32Net.dll \ /reference:$(OUTPUT_DIR)/CSScriptLibrary.dll /reference:$(OUTPUT_DIR)/NUniversalCharDet.dll /reference:$(OUTPUT_DIR)/SharpCompress.dll /reference:$(OUTPUT_DIR)/PIEHid32Net.dll \
/reference:System.Core.dll /reference:System.dll \ /reference:System.Core.dll /reference:System.dll \
/win32icon:$(ICON) $(addprefix /resource:, $(OPEN_BVE_RESOURCE)) /win32icon:$(ICON) $(addprefix /resource:, $(OPEN_BVE_RESOURCE))
...@@ -425,28 +425,28 @@ $(DEBUG_DIR)/$(OPEN_BVE_API_FILE) $(RELEASE_DIR)/$(OPEN_BVE_API_FILE): $(OPEN_BV ...@@ -425,28 +425,28 @@ $(DEBUG_DIR)/$(OPEN_BVE_API_FILE) $(RELEASE_DIR)/$(OPEN_BVE_API_FILE): $(OPEN_BV
$(addprefix /resource:, $(OPEN_BVE_API_RESOURCE)) $(addprefix /resource:, $(OPEN_BVE_API_RESOURCE))
################# ################
# AssimpXParser # # AssimpParser #
################# ################
ASSIMP_X_FOLDERS := $(shell find $(ASSIMP_X_ROOT) -type d) ASSIMP_FOLDERS := $(shell find $(ASSIMP_ROOT) -type d)
ASSIMP_X_SRC := $(foreach sdir, $(ASSIMP_X_FOLDERS), $(wildcard $(sdir)/*.cs)) ASSIMP_SRC := $(foreach sdir, $(ASSIMP_FOLDERS), $(wildcard $(sdir)/*.cs))
ASSIMP_X_DOC := $(addprefix /doc:, $(foreach sdir, $(ASSIMP_X_FOLDERS), $(wildcard $(sdir)/*.xml))) ASSIMP_DOC := $(addprefix /doc:, $(foreach sdir, $(ASSIMP_FOLDERS), $(wildcard $(sdir)/*.xml)))
ASSIMP_X_RESX := $(foreach sdir, $(ASSIMP_X_FOLDERS), $(wildcard $(sdir)/*.resx)) ASSIMP_RESX := $(foreach sdir, $(ASSIMP_FOLDERS), $(wildcard $(sdir)/*.resx))
ASSIMP_X_RESOURCE := $(addprefix $(ASSIMP_X_ROOT)/, $(subst /,., $(subst /./,/, $(patsubst $(dir $(ASSIMP_X_ROOT))%.resx, %.resources, $(ASSIMP_X_RESX))))) ASSIMP_RESOURCE := $(addprefix $(ASSIMP_ROOT)/, $(subst /,., $(subst /./,/, $(patsubst $(dir $(ASSIMP_ROOT))%.resx, %.resources, $(ASSIMP_RESX)))))
ASSIMP_X_OUT =$(OUTPUT_DIR)/$(ASSIMP_X_FILE) ASSIMP_OUT =$(OUTPUT_DIR)/$(ASSIMP_FILE)
$(call create_resource, $(ASSIMP_X_RESOURCE), $(ASSIMP_X_RESX)) $(call create_resource, $(ASSIMP_RESOURCE), $(ASSIMP_RESX))
$(DEBUG_DIR)/$(ASSIMP_X_FILE): $(DEBUG_DEPEND) $(DEBUG_DIR)/$(ASSIMP_FILE): $(DEBUG_DEPEND)
$(RELEASE_DIR)/$(ASSIMP_X_FILE): $(RELEASE_DEPEND) $(RELEASE_DIR)/$(ASSIMP_FILE): $(RELEASE_DEPEND)
$(DEBUG_DIR)/$(ASSIMP_X_FILE) $(RELEASE_DIR)/$(ASSIMP_X_FILE): $(ASSIMP_X_SRC) $(ASSIMP_X_RESOURCE) $(DEBUG_DIR)/$(ASSIMP_FILE) $(RELEASE_DIR)/$(ASSIMP_FILE): $(ASSIMP_SRC) $(ASSIMP_RESOURCE)
@echo $(COLOR_MAGENTA)Building $(COLOR_CYAN)$(ASSIMP_X_OUT)$(COLOR_END) @echo $(COLOR_MAGENTA)Building $(COLOR_CYAN)$(ASSIMP_OUT)$(COLOR_END)
@$(CSC) /out:$(ASSIMP_X_OUT) /target:library $(ASSIMP_X_SRC) $(ARGS) $(ASSIMP_X_DOC) \ @$(CSC) /out:$(ASSIMP_OUT) /target:library $(ASSIMP_SRC) $(ARGS) $(ASSIMP_DOC) \
/reference:$(OUTPUT_DIR)/Ionic.Zlib.dll /reference:$(OUTPUT_DIR)/OpenTK.dll \ /reference:$(OUTPUT_DIR)/Ionic.Zlib.dll /reference:$(OUTPUT_DIR)/OpenTK.dll \
/reference:System.Core.dll /reference:System.dll \ /reference:System.Core.dll /reference:System.dll \
$(addprefix /resource:, $(ASSIMP_X_RESOURCE)) $(addprefix /resource:, $(ASSIMP_RESOURCE))
######################## ########################
# DefaultDisplayPlugin # # DefaultDisplayPlugin #
...@@ -780,7 +780,7 @@ $(RELEASE_DIR)/$(OBJECT_VIEWER_FILE): $(RELEASE_DIR)/$(OPEN_BVE_API_FILE) ...@@ -780,7 +780,7 @@ $(RELEASE_DIR)/$(OBJECT_VIEWER_FILE): $(RELEASE_DIR)/$(OPEN_BVE_API_FILE)
$(DEBUG_DIR)/$(OBJECT_VIEWER_FILE) $(RELEASE_DIR)/$(OBJECT_VIEWER_FILE): $(OBJECT_VIEWER_SRC) $(OBJECT_VIEWER_RESOURCE) $(DEBUG_DIR)/$(OBJECT_VIEWER_FILE) $(RELEASE_DIR)/$(OBJECT_VIEWER_FILE): $(OBJECT_VIEWER_SRC) $(OBJECT_VIEWER_RESOURCE)
@echo $(COLOR_MAGENTA)Building $(COLOR_CYAN)$(OBJECT_VIEWER_OUT)$(COLOR_END) @echo $(COLOR_MAGENTA)Building $(COLOR_CYAN)$(OBJECT_VIEWER_OUT)$(COLOR_END)
@$(CSC) /out:$(OBJECT_VIEWER_OUT) /target:winexe /main:OpenBve.Program $(OBJECT_VIEWER_SRC) $(ARGS) $(OBJECT_VIEWER_DOC) \ @$(CSC) /out:$(OBJECT_VIEWER_OUT) /target:winexe /main:OpenBve.Program $(OBJECT_VIEWER_SRC) $(ARGS) $(OBJECT_VIEWER_DOC) \
/reference:$(OPEN_BVE_API_OUT) /reference:$(ASSIMP_X_OUT) /reference:$(FORMATS_MSTS_OUT) /reference:$(FORMATS_DIRECTX_OUT) /reference:$(OUTPUT_DIR)/OpenTK.dll /reference:$(OUTPUT_DIR)/SharpCompress.dll /reference:System.Core.dll \ /reference:$(OPEN_BVE_API_OUT) /reference:$(ASSIMP_OUT) /reference:$(FORMATS_MSTS_OUT) /reference:$(FORMATS_DIRECTX_OUT) /reference:$(OUTPUT_DIR)/OpenTK.dll /reference:$(OUTPUT_DIR)/SharpCompress.dll /reference:System.Core.dll \
/win32icon:$(ICON) $(addprefix /resource:, $(OBJECT_VIEWER_RESOURCE)) /win32icon:$(ICON) $(addprefix /resource:, $(OBJECT_VIEWER_RESOURCE))
############### ###############
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{572CD7FF-A0C9-4A48-81B7-79B65E37D3C7}</ProjectGuid> <ProjectGuid>{77CCAE62-D374-468E-98A0-DD8ADB461C10}</ProjectGuid>
<OutputType>Library</OutputType> <OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>AssimpNET</RootNamespace> <RootNamespace>AssimpParser</RootNamespace>
<AssemblyName>AssimpXParser</AssemblyName> <AssemblyName>AssimpParser</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion> <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
</PropertyGroup> </PropertyGroup>
...@@ -33,19 +33,33 @@ ...@@ -33,19 +33,33 @@
<Reference Include="Ionic.Zlib"> <Reference Include="Ionic.Zlib">
<HintPath>..\..\dependencies\Ionic.Zlib.dll</HintPath> <HintPath>..\..\dependencies\Ionic.Zlib.dll</HintPath>
</Reference> </Reference>
<Reference Include="OpenTK, Version=3.0.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4, processorArchitecture=MSIL"> <Reference Include="OpenTK">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\dependencies\OpenTK.dll</HintPath> <HintPath>..\..\dependencies\OpenTK.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" /> <Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="DeflateCompression.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="XFileHelper.cs" /> <Compile Include="Wavefront\Mesh.cs" />
<Compile Include="XFileParser.cs" /> <Compile Include="Wavefront\ObjFileData.cs" />
<Compile Include="Wavefront\ObjFileMtlImporter.cs" />
<Compile Include="Wavefront\ObjFileParser.cs" />
<Compile Include="Wavefront\ObjTools.cs" />
<Compile Include="X\DeflateCompression.cs" />
<Compile Include="X\XFileHelper.cs" />
<Compile Include="X\XFileParser.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\OpenBveApi\OpenBveApi.csproj">
<Project>{27134980-4415-4375-a564-40a9014dfa5f}</Project>
<Name>OpenBveApi</Name>
</ProjectReference>
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
...@@ -55,4 +69,4 @@ ...@@ -55,4 +69,4 @@
<Target Name="AfterBuild"> <Target Name="AfterBuild">
</Target> </Target>
--> -->
</Project> </Project>
\ No newline at end of file
using System.Reflection; using System.Reflection;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
// アセンブリに関する一般情報は以下の属性セットをとおして制御されます。 // アセンブリに関する一般情報は以下の属性セットをとおして制御されます。
// アセンブリに関連付けられている情報を変更するには、 // アセンブリに関連付けられている情報を変更するには、
// これらの属性値を変更してください。 // これらの属性値を変更してください。
[assembly: AssemblyTitle("AssimpXParser")] [assembly: AssemblyTitle("AssimpParser")]
[assembly: AssemblyDescription("")] [assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")] [assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("AssimpXParser")] [assembly: AssemblyProduct("AssimpParser")]
[assembly: AssemblyCopyright("assimp team, The openBVE Project")] [assembly: AssemblyCopyright("assimp team, The openBVE Project")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
// ComVisible を false に設定すると、その型はこのアセンブリ内で COM コンポーネントから // ComVisible を false に設定すると、その型はこのアセンブリ内で COM コンポーネントから
// 参照不可能になります。COM からこのアセンブリ内の型にアクセスする場合は、 // 参照不可能になります。COM からこのアセンブリ内の型にアクセスする場合は、
// その型の ComVisible 属性を true に設定してください。 // その型の ComVisible 属性を true に設定してください。
[assembly: ComVisible(false)] [assembly: ComVisible(false)]
// 次の GUID は、このプロジェクトが COM に公開される場合の、typelib の ID です // 次の GUID は、このプロジェクトが COM に公開される場合の、typelib の ID です
[assembly: Guid("af0471c9-5f0b-4ffb-b156-e887c6e9048f")] [assembly: Guid("403e58cc-8713-478f-9deb-6239c07d80e8")]
// アセンブリのバージョン情報は、以下の 4 つの値で構成されています: // アセンブリのバージョン情報は、以下の 4 つの値で構成されています:
// //
// Major Version // Major Version
// Minor Version // Minor Version
// Build Number // Build Number
// Revision // Revision
// //
// すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を // すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を
// 既定値にすることができます: // 既定値にすることができます:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
// Open Asset Import Library (assimp)
//
// Copyright (c) 2006-2016, assimp team, 2018, The openBVE Project
// All rights reserved.
//
// Redistribution and use of this software in source and binary forms,
// with or without modification, are permitted provided that the
// following conditions are met:
//
// * Redistributions of source code must retain the above
// copyright notice, this list of conditions and the
// following disclaimer.
//
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the
// following disclaimer in the documentation and/or other
// materials provided with the distribution.
//
// * Neither the name of the assimp team, nor the names of its
// contributors may be used to endorse or promote products
// derived from this software without specific prior
// written permission of the assimp team.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
//
//
// ******************************************************************************
//
// AN EXCEPTION applies to all files in the ./test/models-nonbsd folder.
// These are 3d models for testing purposes, from various free sources
// on the internet. They are - unless otherwise stated - copyright of
// their respective creators, which may impose additional requirements
// on the use of their work. For any of these models, see
// <model-name>.source.txt for more legal information. Contact us if you
// are a copyright holder and believe that we credited you inproperly or
// if you don't want your files to appear in the repository.
//
//
// ******************************************************************************
//
// Poly2Tri Copyright (c) 2009-2010, Poly2Tri Contributors
// http://code.google.com/p/poly2tri/
//
// All rights reserved.
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
// * Neither the name of Poly2Tri nor the names of its contributors may be
// used to endorse or promote products derived from this software without specific
// prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
namespace AssimpNET.Obj
{
// ---------------------------------------------------------------------------
/** @brief Enumerates the types of geometric primitives supported by Assimp.
*
* @see aiFace Face data structure
* @see aiProcess_SortByPType Per-primitive sorting of meshes
* @see aiProcess_Triangulate Automatic triangulation
* @see AI_CONFIG_PP_SBP_REMOVE Removal of specific primitive types.
*/
public enum PrimitiveType
{
/** A point primitive.
*
* This is just a single vertex in the virtual world,
* #aiFace contains just one index for such a primitive.
*/
PrimitiveType_POINT = 0x1,
/** A line primitive.
*
* This is a line defined through a start and an end position.
* #aiFace contains exactly two indices for such a primitive.
*/
PrimitiveType_LINE = 0x2,
/** A triangular primitive.
*
* A triangle consists of three indices.
*/
PrimitiveType_TRIANGLE = 0x4,
/** A higher-level polygon with more than 3 edges.
*
* A triangle is a polygon, but polygon in this context means
* "all polygons that are not triangles". The "Triangulate"-Step
* is provided for your convenience, it splits all polygons in
* triangles (which are much easier to handle).
*/
PrimitiveType_POLYGON = 0x8
};
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -84,7 +84,7 @@ using VectorKey = System.Collections.Generic.KeyValuePair<double, OpenTK.Vector3 ...@@ -84,7 +84,7 @@ using VectorKey = System.Collections.Generic.KeyValuePair<double, OpenTK.Vector3
using QuatKey = System.Collections.Generic.KeyValuePair<double, OpenTK.Quaternion>; using QuatKey = System.Collections.Generic.KeyValuePair<double, OpenTK.Quaternion>;
using MatrixKey = System.Collections.Generic.KeyValuePair<double, OpenTK.Matrix4>; using MatrixKey = System.Collections.Generic.KeyValuePair<double, OpenTK.Matrix4>;
namespace AssimpNET namespace AssimpNET.X
{ {
/** Helper structure representing a XFile mesh face */ /** Helper structure representing a XFile mesh face */
public class Face public class Face
......
...@@ -91,7 +91,7 @@ using VectorKey = System.Collections.Generic.KeyValuePair<double, OpenTK.Vector3 ...@@ -91,7 +91,7 @@ using VectorKey = System.Collections.Generic.KeyValuePair<double, OpenTK.Vector3
using QuatKey = System.Collections.Generic.KeyValuePair<double, OpenTK.Quaternion>; using QuatKey = System.Collections.Generic.KeyValuePair<double, OpenTK.Quaternion>;
using MatrixKey = System.Collections.Generic.KeyValuePair<double, OpenTK.Matrix4>; using MatrixKey = System.Collections.Generic.KeyValuePair<double, OpenTK.Matrix4>;
namespace AssimpNET namespace AssimpNET.X
{ {
public class XFileParser public class XFileParser
{ {
......
...@@ -119,7 +119,8 @@ namespace OpenBve { ...@@ -119,7 +119,8 @@ namespace OpenBve {
internal int AntialiasingLevel; internal int AntialiasingLevel;
internal int ObjectOptimizationBasicThreshold; internal int ObjectOptimizationBasicThreshold;
internal int ObjectOptimizationFullThreshold; internal int ObjectOptimizationFullThreshold;
internal int UseNewXParser; internal int CurrentXParser;
internal int CurrentObjParser;
} }
internal static Options CurrentOptions; internal static Options CurrentOptions;
......
...@@ -1541,11 +1541,11 @@ namespace OpenBve ...@@ -1541,11 +1541,11 @@ namespace OpenBve
Result = CsvB3dObjectParser.ReadObject(FileName, Encoding, LoadMode, ForceTextureRepeatX, ForceTextureRepeatY); Result = CsvB3dObjectParser.ReadObject(FileName, Encoding, LoadMode, ForceTextureRepeatX, ForceTextureRepeatY);
break; break;
case ".x": case ".x":
if (Interface.CurrentOptions.UseNewXParser > 0) if (Interface.CurrentOptions.CurrentXParser > 0)
{ {
try try
{ {
if (Interface.CurrentOptions.UseNewXParser == 1) if (Interface.CurrentOptions.CurrentXParser == 1)
{ {
Result = NewXParser.ReadObject(FileName, Encoding, LoadMode); Result = NewXParser.ReadObject(FileName, Encoding, LoadMode);
} }
...@@ -1576,7 +1576,22 @@ namespace OpenBve ...@@ -1576,7 +1576,22 @@ namespace OpenBve
Result = Ls3DGrpParser.ReadObject(FileName, Encoding, LoadMode, Rotation); Result = Ls3DGrpParser.ReadObject(FileName, Encoding, LoadMode, Rotation);
break; break;
case ".obj": case ".obj":
Result = WavefrontObjParser.ReadObject(FileName, Encoding, LoadMode, ForceTextureRepeatX, ForceTextureRepeatY); if (Interface.CurrentOptions.CurrentObjParser == 1)
{
try
{
Result = AssimpObjParser.ReadObject(FileName);
}
catch (Exception e)
{
Interface.AddMessage(MessageType.Error, false, "The new Obj parser raised the following exception: " + e);
Result = WavefrontObjParser.ReadObject(FileName, Encoding, LoadMode, ForceTextureRepeatX, ForceTextureRepeatY);
}
}
else
{
Result = WavefrontObjParser.ReadObject(FileName, Encoding, LoadMode, ForceTextureRepeatX, ForceTextureRepeatY);
}
break; break;
case ".s": case ".s":
Result = MsTsShapeParser.ReadObject(FileName); Result = MsTsShapeParser.ReadObject(FileName);
...@@ -1637,11 +1652,11 @@ namespace OpenBve ...@@ -1637,11 +1652,11 @@ namespace OpenBve
Result = CsvB3dObjectParser.ReadObject(FileName, Encoding, LoadMode, ForceTextureRepeatX, ForceTextureRepeatY); Result = CsvB3dObjectParser.ReadObject(FileName, Encoding, LoadMode, ForceTextureRepeatX, ForceTextureRepeatY);
break; break;
case ".x": case ".x":
if (Interface.CurrentOptions.UseNewXParser > 0) if (Interface.CurrentOptions.CurrentXParser > 0)
{ {
try try
{ {
if (Interface.CurrentOptions.UseNewXParser == 1) if (Interface.CurrentOptions.CurrentXParser == 1)
{ {
Result = NewXParser.ReadObject(FileName, Encoding, LoadMode); Result = NewXParser.ReadObject(FileName, Encoding, LoadMode);
} }
...@@ -1672,7 +1687,22 @@ namespace OpenBve ...@@ -1672,7 +1687,22 @@ namespace OpenBve
Interface.AddMessage(MessageType.Error, false, "Tried to load an animated object even though only static objects are allowed: " + FileName); Interface.AddMessage(MessageType.Error, false, "Tried to load an animated object even though only static objects are allowed: " + FileName);
return null; return null;
case ".obj": case ".obj":
Result = WavefrontObjParser.ReadObject(FileName, Encoding, LoadMode, ForceTextureRepeatX, ForceTextureRepeatY); if (Interface.CurrentOptions.CurrentObjParser == 1)
{
try
{
Result = AssimpObjParser.ReadObject(FileName);
}
catch (Exception e)
{
Interface.AddMessage(MessageType.Error, false, "The new Obj parser raised the following exception: " + e);
Result = WavefrontObjParser.ReadObject(FileName, Encoding, LoadMode, ForceTextureRepeatX, ForceTextureRepeatY);
}
}
else
{
Result = WavefrontObjParser.ReadObject(FileName, Encoding, LoadMode, ForceTextureRepeatX, ForceTextureRepeatY);
}
break; break;
default: default:
Interface.AddMessage(MessageType.Error, false, "The file extension is not supported: " + FileName); Interface.AddMessage(MessageType.Error, false, "The file extension is not supported: " + FileName);
......
...@@ -80,6 +80,7 @@ ...@@ -80,6 +80,7 @@
<Compile Include="FunctionScripts.cs" /> <Compile Include="FunctionScripts.cs" />
<Compile Include="Hosts.cs" /> <Compile Include="Hosts.cs" />
<Compile Include="Options.cs" /> <Compile Include="Options.cs" />
<Compile Include="Parsers\AssimpObjParser.cs" />
<Compile Include="Parsers\Generic\AssimpXParser.cs" /> <Compile Include="Parsers\Generic\AssimpXParser.cs" />
<Compile Include="Parsers\Ls3DGrpParser.cs" /> <Compile Include="Parsers\Ls3DGrpParser.cs" />
<Compile Include="Parsers\Ls3DObjectParser.cs" /> <Compile Include="Parsers\Ls3DObjectParser.cs" />
...@@ -121,9 +122,9 @@ ...@@ -121,9 +122,9 @@
</EmbeddedResource> </EmbeddedResource>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\AssimpXParser\AssimpXParser.csproj"> <ProjectReference Include="..\AssimpParser\AssimpParser.csproj">
<Project>{572cd7ff-a0c9-4a48-81b7-79b65e37d3c7}</Project> <Project>{77ccae62-d374-468e-98a0-dd8adb461c10}</Project>
<Name>AssimpXParser</Name> <Name>AssimpParser</Name>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\OpenBveApi\OpenBveApi.csproj"> <ProjectReference Include="..\OpenBveApi\OpenBveApi.csproj">
<Project>{27134980-4415-4375-A564-40A9014DFA5F}</Project> <Project>{27134980-4415-4375-A564-40A9014DFA5F}</Project>
...@@ -136,7 +137,7 @@ ...@@ -136,7 +137,7 @@
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\Plugins\Formats.Msts\Formats.Msts.csproj"> <ProjectReference Include="..\Plugins\Formats.Msts\Formats.Msts.csproj">
<Project>{E81B7BD8-A326-47D3-B7EE-E9C7D4D119FA}</Project> <Project>{E81B7BD8-A326-47D3-B7EE-E9C7D4D119FA}</Project>
<Name>OpenBve.Formats.Msts</Name> <Name>Formats.Msts</Name>
<Private>False</Private> <Private>False</Private>
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>
......
...@@ -130,6 +130,36 @@ namespace OpenBve ...@@ -130,6 +130,36 @@ namespace OpenBve
} }
} break; } break;
} break; } break;
case "parsers":
switch (Key)
{
case "xobject":
{
int p;
if (!int.TryParse(Value, NumberStyles.Integer, Culture, out p) || p < 0 || p > 3)
{
Interface.CurrentOptions.CurrentXParser = 0;
}
else
{
Interface.CurrentOptions.CurrentXParser = p;
}
break;
}
case "objobject":
{
int p;
if (!int.TryParse(Value, NumberStyles.Integer, Culture, out p) || p < 0 || p > 2)
{
Interface.CurrentOptions.CurrentObjParser = 0;
}
else
{
Interface.CurrentOptions.CurrentObjParser = p;
}
break;
}
} break;
} }
} }
} }
...@@ -169,6 +199,10 @@ namespace OpenBve ...@@ -169,6 +199,10 @@ namespace OpenBve
Builder.AppendLine("anisotropicfilteringlevel = " + Interface.CurrentOptions.AnisotropicFilteringLevel.ToString(Culture)); Builder.AppendLine("anisotropicfilteringlevel = " + Interface.CurrentOptions.AnisotropicFilteringLevel.ToString(Culture));
Builder.AppendLine("antialiasinglevel = " + Interface.CurrentOptions.AntialiasingLevel.ToString(Culture)); Builder.AppendLine("antialiasinglevel = " + Interface.CurrentOptions.AntialiasingLevel.ToString(Culture));
Builder.AppendLine("transparencyMode = " + ((int)Interface.CurrentOptions.TransparencyMod