[Pkg-cli-apps-commits] [SCM] openbve branch, master, updated. debian/1.4.0.9-1-4-g04e55e0

Paul Sladen debian at paul.sladen.org
Tue Mar 13 13:08:46 UTC 2012


The following commit has been merged in the master branch:
commit 04e55e06c49457fa545b1851114448c0a300b88b
Merge: 24262385cab6cdf89f2ea86e2cbc5d0f612ab56a 001472828570bb91dc92edf96af609a034141af0
Author: Paul Sladen <debian at paul.sladen.org>
Date:   Tue Mar 13 12:46:05 2012 +0000

    New upstream stable release (1.4.1.0)

diff --combined openBVE/OpenBve/OldCode/PluginManager.cs
index 2ff73a9,28c1be2..6f1913f
--- a/openBVE/OpenBve/OldCode/PluginManager.cs
+++ b/openBVE/OpenBve/OldCode/PluginManager.cs
@@@ -455,14 -455,6 +455,14 @@@ namespace OpenBve 
  		/// <returns>Whether the plugin was loaded successfully.</returns>
  		internal static bool LoadDefaultPlugin(TrainManager.Train train, string trainFolder) {
  			string file = OpenBveApi.Path.CombineFile(Program.FileSystem.GetDataFolder("Plugins"), "OpenBveAts.dll");
 +			// Executable data (== .dlls) may need to live somewhere else, so such an
 +			// option probably may need adding to 'filesystem.cfg' in the future. -sladen
 +			// Note that should path determination logic may want to be shared with
 +			// the similiar statement in System/Plugins.cs
 +			if(!System.IO.File.Exists(file))
 +				file = OpenBveApi.Path.CombineFile(OpenBveApi.Path.CombineDirectory(System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Plugins"), "OpenBveAts.dll");
 +			// Or ... just hard code it as a massive kludge -sladen
 +			//file = "/usr/lib/openbve/Plugins/OpenBveAts.dll";
  			bool success = LoadPlugin(train, file, trainFolder);
  			if (success) {
  				train.Plugin.IsDefault = true;
@@@ -530,17 -522,14 +530,14 @@@
  					return false;
  				}
  				foreach (Type type in types) {
- 					if (type.IsPublic && (type.Attributes & TypeAttributes.Abstract) == 0) {
- 						object instance = assembly.CreateInstance(type.FullName);
- 						IRuntime api = instance as IRuntime;
- 						if (api != null) {
- 							train.Plugin = new NetPlugin(pluginFile, trainFolder, api, train);
- 							if (train.Plugin.Load(specs, mode)) {
- 								return true;
- 							} else {
- 								train.Plugin = null;
- 								return false;
- 							}
+ 					if (typeof(IRuntime).IsAssignableFrom(type)) {
+ 						IRuntime api = assembly.CreateInstance(type.FullName) as IRuntime;
+ 						train.Plugin = new NetPlugin(pluginFile, trainFolder, api, train);
+ 						if (train.Plugin.Load(specs, mode)) {
+ 							return true;
+ 						} else {
+ 							train.Plugin = null;
+ 							return false;
  						}
  					}
  				}
diff --combined openBVE/OpenBve/OldCode/Renderer.cs
index c2096c3,91d9eac..54d7b0e
--- a/openBVE/OpenBve/OldCode/Renderer.cs
+++ b/openBVE/OpenBve/OldCode/Renderer.cs
@@@ -277,7 -277,7 +277,7 @@@ namespace OpenBve 
  			Gl.glBlendFunc(Gl.GL_SRC_ALPHA, Gl.GL_ONE_MINUS_SRC_ALPHA);
  			Gl.glDisable(Gl.GL_BLEND); BlendEnabled = false;
  			Gl.glEnable(Gl.GL_DEPTH_TEST);
 -			Gl.glDepthMask(Gl.GL_TRUE);
 +			Gl.glDepthMask(true);
  			Gl.glMaterialfv(Gl.GL_FRONT_AND_BACK, Gl.GL_EMISSION, new float[] { 0.0f, 0.0f, 0.0f, 1.0f }); EmissiveEnabled = false;
  			SetAlphaFunc(Gl.GL_GREATER, 0.9f);
  		}
@@@ -435,7 -435,7 +435,7 @@@
  			SortPolygons(DynamicAlpha);
  			if (Interface.CurrentOptions.TransparencyMode == TransparencyMode.Performance) {
  				Gl.glEnable(Gl.GL_BLEND); BlendEnabled = true;
 -				Gl.glDepthMask(Gl.GL_FALSE);
 +				Gl.glDepthMask(false);
  				SetAlphaFunc(Gl.GL_GREATER, 0.0f);
  				for (int i = 0; i < DynamicAlpha.FaceCount; i++) {
  					RenderFace(ref DynamicAlpha.Faces[i], cx, cy, cz);
@@@ -443,7 -443,7 +443,7 @@@
  			} else {
  				Gl.glDisable(Gl.GL_BLEND); BlendEnabled = false;
  				SetAlphaFunc(Gl.GL_EQUAL, 1.0f);
 -				Gl.glDepthMask(Gl.GL_TRUE);
 +				Gl.glDepthMask(true);
  				for (int i = 0; i < DynamicAlpha.FaceCount; i++) {
  					int r = (int)ObjectManager.Objects[DynamicAlpha.Faces[i].ObjectIndex].Mesh.Faces[DynamicAlpha.Faces[i].FaceIndex].Material;
  					if (ObjectManager.Objects[DynamicAlpha.Faces[i].ObjectIndex].Mesh.Materials[r].BlendMode == World.MeshMaterialBlendMode.Normal & ObjectManager.Objects[DynamicAlpha.Faces[i].ObjectIndex].Mesh.Materials[r].GlowAttenuationData == 0) {
@@@ -454,7 -454,7 +454,7 @@@
  				}
  				Gl.glEnable(Gl.GL_BLEND); BlendEnabled = true;
  				SetAlphaFunc(Gl.GL_LESS, 1.0f);
 -				Gl.glDepthMask(Gl.GL_FALSE);
 +				Gl.glDepthMask(false);
  				bool additive = false;
  				for (int i = 0; i < DynamicAlpha.FaceCount; i++) {
  					int r = (int)ObjectManager.Objects[DynamicAlpha.Faces[i].ObjectIndex].Mesh.Faces[DynamicAlpha.Faces[i].FaceIndex].Material;
@@@ -475,7 -475,7 +475,7 @@@
  			}
  			// motion blur
  			Gl.glDisable(Gl.GL_DEPTH_TEST);
 -			Gl.glDepthMask(Gl.GL_FALSE);
 +			Gl.glDepthMask(false);
  			SetAlphaFunc(Gl.GL_GREATER, 0.0f);
  			if (Interface.CurrentOptions.MotionBlur != Interface.MotionBlurMode.None) {
  				if (LightingEnabled) {
@@@ -493,7 -493,7 +493,7 @@@
  			Glu.gluLookAt(0.0, 0.0, 0.0, dx, dy, dz, ux, uy, uz);
  			if (World.CameraRestriction == World.CameraRestrictionMode.NotAvailable) {
  				// 3d cab
 -				Gl.glDepthMask(Gl.GL_TRUE);
 +				Gl.glDepthMask(true);
  				Gl.glEnable(Gl.GL_DEPTH_TEST);
  				Gl.glClear(Gl.GL_DEPTH_BUFFER_BIT);
  				if (!LightingEnabled) {
@@@ -511,7 -511,7 +511,7 @@@
  				SortPolygons(OverlayAlpha);
  				if (Interface.CurrentOptions.TransparencyMode == TransparencyMode.Performance) {
  					Gl.glEnable(Gl.GL_BLEND); BlendEnabled = true;
 -					Gl.glDepthMask(Gl.GL_FALSE);
 +					Gl.glDepthMask(false);
  					SetAlphaFunc(Gl.GL_GREATER, 0.0f);
  					for (int i = 0; i < OverlayAlpha.FaceCount; i++) {
  						RenderFace(ref OverlayAlpha.Faces[i], cx, cy, cz);
@@@ -519,7 -519,7 +519,7 @@@
  				} else {
  					Gl.glDisable(Gl.GL_BLEND); BlendEnabled = false;
  					SetAlphaFunc(Gl.GL_EQUAL, 1.0f);
 -					Gl.glDepthMask(Gl.GL_TRUE);
 +					Gl.glDepthMask(true);
  					for (int i = 0; i < OverlayAlpha.FaceCount; i++) {
  						int r = (int)ObjectManager.Objects[OverlayAlpha.Faces[i].ObjectIndex].Mesh.Faces[OverlayAlpha.Faces[i].FaceIndex].Material;
  						if (ObjectManager.Objects[OverlayAlpha.Faces[i].ObjectIndex].Mesh.Materials[r].BlendMode == World.MeshMaterialBlendMode.Normal & ObjectManager.Objects[OverlayAlpha.Faces[i].ObjectIndex].Mesh.Materials[r].GlowAttenuationData == 0) {
@@@ -530,7 -530,7 +530,7 @@@
  					}
  					Gl.glEnable(Gl.GL_BLEND); BlendEnabled = true;
  					SetAlphaFunc(Gl.GL_LESS, 1.0f);
 -					Gl.glDepthMask(Gl.GL_FALSE);
 +					Gl.glDepthMask(false);
  					bool additive = false;
  					for (int i = 0; i < OverlayAlpha.FaceCount; i++) {
  						int r = (int)ObjectManager.Objects[OverlayAlpha.Faces[i].ObjectIndex].Mesh.Faces[OverlayAlpha.Faces[i].FaceIndex].Material;
@@@ -558,7 -558,7 +558,7 @@@
  				if (!BlendEnabled) {
  					Gl.glEnable(Gl.GL_BLEND); BlendEnabled = true;
  				}
 -				Gl.glDepthMask(Gl.GL_FALSE);
 +				Gl.glDepthMask(false);
  				Gl.glDisable(Gl.GL_DEPTH_TEST);
  				UnsetAlphaFunc();
  				SortPolygons(OverlayAlpha);
@@@ -2357,7 -2357,7 +2357,7 @@@
  					"=sound",
  					"sound buffers: " + soundBuffersLoaded.ToString(Culture) + " / " + soundBuffersRegistered.ToString(Culture),
  					"sound sources: " + soundSourcesPlaying.ToString(Culture) + " / " + soundSourcesRegistered.ToString(Culture),
- 					(Interface.CurrentOptions.SoundModel == Sounds.SoundModels.Experimental ? "log clamp factor: " + Sounds.ClampFactorLogarithm.ToString("0.00") : "outer radius factor: " + Sounds.OuterRadiusFactor.ToString("0.00", Culture)),
+ 					(Interface.CurrentOptions.SoundModel == Sounds.SoundModels.Inverse ? "log clamp factor: " + Sounds.LogClampFactor.ToString("0.00") : "outer radius factor: " + Sounds.OuterRadiusFactor.ToString("0.00", Culture)),
  					"",
  					"=debug",
  					"train plugin status: " + (TrainManager.PlayerTrain.Plugin != null ? (TrainManager.PlayerTrain.Plugin.PluginValid ? "ok" : "error") : "n/a"),
diff --combined openBVE/OpenBve/System/Plugins.cs
index 2e12622,c312ff8..b3d0c3c
--- a/openBVE/OpenBve/System/Plugins.cs
+++ b/openBVE/OpenBve/System/Plugins.cs
@@@ -75,13 -75,6 +75,13 @@@ namespace OpenBve 
  		internal static bool LoadPlugins() {
  			UnloadPlugins();
  			string folder = Program.FileSystem.GetDataFolder("Plugins");
 +			// Executable data (== .dlls) may need to live somewhere else, so such an
 +			// option probably may need adding to 'filesystem.cfg' in the future. -sladen
 +			if(!System.IO.Directory.Exists(folder))
 +				folder = OpenBveApi.Path.CombineDirectory(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Plugins");
 +			// And if that doesn't work, just hard code it. -sladen
 +			//if(!System.IO.Directory.Exists(folder))
 +			//  folder = "/usr/lib/openbve/Plugins";
  			string[] files = Directory.GetFiles(folder);
  			List<Plugin> list = new List<Plugin>();
  			StringBuilder builder = new StringBuilder();
@@@ -93,6 -86,7 +93,7 @@@
  						Plugin plugin = new Plugin(file);
  						Assembly assembly = Assembly.LoadFile(file);
  						Type[] types = assembly.GetTypes();
+ 						bool iruntime = false;
  						foreach (Type type in types) {
  							if (type.IsSubclassOf(typeof(OpenBveApi.Textures.TextureInterface))) {
  								plugin.Texture = (OpenBveApi.Textures.TextureInterface)assembly.CreateInstance(type.FullName);
@@@ -103,10 -97,16 +104,16 @@@
  							if (type.IsSubclassOf(typeof(OpenBveApi.Objects.ObjectInterface))) {
  								plugin.Object = (OpenBveApi.Objects.ObjectInterface)assembly.CreateInstance(type.FullName);
  							}
+ 							if (typeof(OpenBveApi.Runtime.IRuntime).IsAssignableFrom(type)) {
+ 								iruntime = true;
+ 							}
  						}
  						if (plugin.Texture != null | plugin.Sound != null | plugin.Object != null) {
  							plugin.Load();
  							list.Add(plugin);
+ 						} else if (!iruntime) {
+ 							builder.Append("Plugin ").Append(Path.GetFileName(file)).AppendLine(" does not implement compatible interfaces.");
+ 							builder.AppendLine();
  						}
  						#if !DEBUG
  					} catch (Exception ex) {
diff --combined openBVE/OpenBveApi/OpenBveApi.csproj
index 3f20024,0b8bc43..c53c842
--- a/openBVE/OpenBveApi/OpenBveApi.csproj
+++ b/openBVE/OpenBveApi/OpenBveApi.csproj
@@@ -7,7 -7,7 +7,7 @@@
      <OutputType>Library</OutputType>
      <RootNamespace>OpenBveApi</RootNamespace>
      <AssemblyName>OpenBveApi</AssemblyName>
-     <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+     <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
      <AppDesignerFolder>Properties</AppDesignerFolder>
      <SourceAnalysisOverrideSettingsFile>C:\Documents and Settings\Administrator\Application Data\ICSharpCode/SharpDevelop3.0\Settings.SourceAnalysis</SourceAnalysisOverrideSettingsFile>
      <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
@@@ -15,7 -15,8 +15,8 @@@
      <WarningLevel>4</WarningLevel>
      <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
      <DocumentationFile>bin\Release\OpenBveApi.xml</DocumentationFile>
-     <TargetFrameworkProfile>Client</TargetFrameworkProfile>
+     <TargetFrameworkProfile>
+     </TargetFrameworkProfile>
    </PropertyGroup>
    <PropertyGroup Condition=" '$(Platform)' == 'x86' ">
      <PlatformTarget>AnyCPU</PlatformTarget>
@@@ -34,8 -35,8 +35,8 @@@
    </PropertyGroup>
    <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
      <OutputPath>bin\Release\</OutputPath>
 -    <DebugSymbols>false</DebugSymbols>
 -    <DebugType>None</DebugType>
 +    <DebugSymbols>True</DebugSymbols>
 +    <DebugType>PdbOnly</DebugType>
      <Optimize>True</Optimize>
      <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
      <DefineConstants>TRACE</DefineConstants>
@@@ -75,4 -76,4 +76,4 @@@
        <DependentUpon>Math.cs</DependentUpon>
      </Compile>
    </ItemGroup>
 -</Project>
 +</Project>

-- 
openbve



More information about the Pkg-cli-apps-commits mailing list