瀏覽代碼

Build: Updated 'bsf' to a new version

BearishSun 7 年之前
父節點
當前提交
f6dc6ab3ac

+ 2 - 2
CMakeLists.txt

@@ -41,8 +41,8 @@ check_and_update_binary_deps(Banshee ${PROJECT_SOURCE_DIR}/Dependencies/ ${BS_PR
 check_and_update_builtin_assets(Banshee ${PROJECT_SOURCE_DIR}/Data/Raw Raw ${BS_BUILTIN_ASSETS_VERSION} NO)
 		
 ## Import built-in assets
-if(${BUILD_ASSETS})
-	run_import_tool(Banshee ${PROJECT_SOURCE_DIR} "--editor")
+if(${INCLUDE_ASSET_PACKAGING_SCRIPTS})
+	add_run_asset_import_target(EditorBuiltinAssets ${PROJECT_SOURCE_DIR}/Data ${PROJECT_SOURCE_DIR} "--editor")
 endif()
 
 ## Fetch built-in assets

+ 3 - 0
Source/Banshee3D/CMakeLists.txt

@@ -8,6 +8,9 @@ else()
 	add_executable(Banshee3D ${BS_BANSHEE3D_SRC})
 endif()
 
+# Common flags
+add_common_flags(Banshee3D)
+
 # Includes
 target_include_directories(Banshee3D PRIVATE "./")
 

+ 3 - 0
Source/EditorCore/CMakeLists.txt

@@ -10,6 +10,9 @@ endif()
 # Target
 add_library(EditorCore SHARED ${BS_BANSHEEEDITOR_SRC})
 
+# Common flags
+add_common_flags(EditorCore)
+
 # Includes
 target_include_directories(EditorCore PUBLIC "./")
 

+ 3 - 0
Source/Game/CMakeLists.txt

@@ -8,6 +8,9 @@ else()
 	add_executable(Game ${BS_GAME_SRC})
 endif()
 
+# Common flags
+add_common_flags(Game)
+
 # Includes
 target_include_directories(Game PRIVATE "./")
 

+ 1 - 1
Source/Scripting/MBansheeEditor/Windows/Inspector/InspectableObject.cs

@@ -57,7 +57,7 @@ namespace BansheeEditor
                 Array.Sort(types, (x, y) => string.Compare(x.Name, y.Name, StringComparison.Ordinal));
                 foreach (var type in types)
                 {
-                    createContextMenu.AddItem(type.Namespace + "::" + type.Name,
+                    createContextMenu.AddItem(type.Namespace + "." + type.Name,
                         () => property.SetValue(Activator.CreateInstance(type)));
                 }
             }

+ 1 - 1
Source/Scripting/MBansheeEngine/Generated/ParticleOrientation.generated.cs

@@ -15,7 +15,7 @@ namespace BansheeEngine
 		ViewPlane = 0,
 		/// <summary>Orient towards view (camera) position.</summary>
 		ViewPosition = 1,
-		/// <summary>Orient with a user-provided plane.</summary>
+		/// <summary>Orient with a user-provided axis.</summary>
 		Plane = 2
 	}
 

+ 7 - 7
Source/Scripting/MBansheeEngine/Generated/ParticleSystemSettings.generated.cs

@@ -71,19 +71,19 @@ namespace BansheeEngine
 		}
 
 		/// <summary>
-		/// Determines a plane to orient particles towards. Only used if particle orientation mode is set to  
+		/// Determines a normal of the plane to orient particles towards. Only used if particle orientation mode is set to  
 		/// ParticleOrientation::Plane.
 		/// </summary>
 		[ShowInInspector]
-		public Plane OrientationPlane
+		public Vector3 OrientationPlaneNormal
 		{
 			get
 			{
-				Plane temp;
-				Internal_getorientationPlane(mCachedPtr, out temp);
+				Vector3 temp;
+				Internal_getorientationPlaneNormal(mCachedPtr, out temp);
 				return temp;
 			}
-			set { Internal_setorientationPlane(mCachedPtr, ref value); }
+			set { Internal_setorientationPlaneNormal(mCachedPtr, ref value); }
 		}
 
 		/// <summary>
@@ -211,9 +211,9 @@ namespace BansheeEngine
 		[MethodImpl(MethodImplOptions.InternalCall)]
 		private static extern void Internal_setorientationLockY(IntPtr thisPtr, bool value);
 		[MethodImpl(MethodImplOptions.InternalCall)]
-		private static extern void Internal_getorientationPlane(IntPtr thisPtr, out Plane __output);
+		private static extern void Internal_getorientationPlaneNormal(IntPtr thisPtr, out Vector3 __output);
 		[MethodImpl(MethodImplOptions.InternalCall)]
-		private static extern void Internal_setorientationPlane(IntPtr thisPtr, ref Plane value);
+		private static extern void Internal_setorientationPlaneNormal(IntPtr thisPtr, ref Vector3 value);
 		[MethodImpl(MethodImplOptions.InternalCall)]
 		private static extern ParticleSortMode Internal_getsortMode(IntPtr thisPtr);
 		[MethodImpl(MethodImplOptions.InternalCall)]

+ 18 - 6
Source/Scripting/MBansheeEngine/Utility/PixelUtility.cs

@@ -142,13 +142,22 @@ namespace BansheeEngine
         }
 
         /// <summary>
-        /// Applies gamma correction to the pixels in the provided buffer.
+        /// Converts pixel data in linear space to one in sRGB space. Only converts the RGB components.
         /// </summary>
-        /// <param name="source">Source pixels to gamma correct.</param>
-        /// <param name="gamma">Gamma value to apply.</param>
-        public static void ApplyGamma(PixelData source, float gamma)
+        /// <param name="source">Pixels to convert.</param>
+        public static void LinearToSRGB(PixelData source)
+        {
+            Internal_LinearToSRGB(source);
+
+        }
+
+        /// <summary>
+        /// Converts pixel data in sRGB space to one in linear space. Only converts the RGB components.
+        /// </summary>
+        /// <param name="source">Pixels to convert.</param>
+        public static void SRGBToLinear(PixelData source)
         {
-            Internal_ApplyGamma(source, gamma);
+            Internal_SRGBToLinear(source);
         }
 
         [MethodImpl(MethodImplOptions.InternalCall)]
@@ -182,7 +191,10 @@ namespace BansheeEngine
         private static extern PixelData Internal_Scale(PixelData source, ref PixelVolume newSize, ScaleFilter filter);
 
         [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_ApplyGamma(PixelData source, float gamma);
+        private static extern void Internal_LinearToSRGB(PixelData source);
+
+        [MethodImpl(MethodImplOptions.InternalCall)]
+        private static extern void Internal_SRGBToLinear(PixelData source);
     }
 
     /// <summary>

+ 3 - 0
Source/Scripting/SBansheeEditor/CMakeLists.txt

@@ -10,6 +10,9 @@ add_library(SBansheeEditor SHARED
 	${BS_GENERATED_EDITOR_H_FILES} 
 	${BS_GENERATED_EDITOR_CPP_FILES})
 
+# Common flags
+add_common_flags(SBansheeEditor)
+	
 # Includes
 set(SBansheeEditor_INC 
 	"./"

+ 3 - 0
Source/Scripting/SBansheeEngine/CMakeLists.txt

@@ -10,6 +10,9 @@ add_library(SBansheeEngine SHARED
 	${BS_GENERATED_ENGINE_H_FILES} 
 	${BS_GENERATED_ENGINE_CPP_FILES})
 
+# Common flags
+add_common_flags(SBansheeEngine)
+	
 # Includes
 set(SBansheeEngine_INC 
 	"./"

+ 8 - 8
Source/Scripting/SBansheeEngine/Generated/BsScriptParticleSystemSettings.generated.cpp

@@ -7,7 +7,7 @@
 #include "Wrappers/BsScriptRRefBase.h"
 #include "../../../bsf/Source/Foundation/bsfCore/Material/BsMaterial.h"
 #include "../../../bsf/Source/Foundation/bsfCore/Mesh/BsMesh.h"
-#include "Wrappers/BsScriptPlane.h"
+#include "Wrappers/BsScriptVector.h"
 
 namespace bs
 {
@@ -30,8 +30,8 @@ namespace bs
 		metaData.scriptClass->addInternalCall("Internal_setorientation", (void*)&ScriptParticleSystemSettings::Internal_setorientation);
 		metaData.scriptClass->addInternalCall("Internal_getorientationLockY", (void*)&ScriptParticleSystemSettings::Internal_getorientationLockY);
 		metaData.scriptClass->addInternalCall("Internal_setorientationLockY", (void*)&ScriptParticleSystemSettings::Internal_setorientationLockY);
-		metaData.scriptClass->addInternalCall("Internal_getorientationPlane", (void*)&ScriptParticleSystemSettings::Internal_getorientationPlane);
-		metaData.scriptClass->addInternalCall("Internal_setorientationPlane", (void*)&ScriptParticleSystemSettings::Internal_setorientationPlane);
+		metaData.scriptClass->addInternalCall("Internal_getorientationPlaneNormal", (void*)&ScriptParticleSystemSettings::Internal_getorientationPlaneNormal);
+		metaData.scriptClass->addInternalCall("Internal_setorientationPlaneNormal", (void*)&ScriptParticleSystemSettings::Internal_setorientationPlaneNormal);
 		metaData.scriptClass->addInternalCall("Internal_getsortMode", (void*)&ScriptParticleSystemSettings::Internal_getsortMode);
 		metaData.scriptClass->addInternalCall("Internal_setsortMode", (void*)&ScriptParticleSystemSettings::Internal_setsortMode);
 		metaData.scriptClass->addInternalCall("Internal_getduration", (void*)&ScriptParticleSystemSettings::Internal_getduration);
@@ -180,19 +180,19 @@ namespace bs
 		thisPtr->getInternal()->orientationLockY = value;
 	}
 
-	void ScriptParticleSystemSettings::Internal_getorientationPlane(ScriptParticleSystemSettings* thisPtr, Plane* __output)
+	void ScriptParticleSystemSettings::Internal_getorientationPlaneNormal(ScriptParticleSystemSettings* thisPtr, Vector3* __output)
 	{
-		Plane tmp__output;
-		tmp__output = thisPtr->getInternal()->orientationPlane;
+		Vector3 tmp__output;
+		tmp__output = thisPtr->getInternal()->orientationPlaneNormal;
 
 		*__output = tmp__output;
 
 
 	}
 
-	void ScriptParticleSystemSettings::Internal_setorientationPlane(ScriptParticleSystemSettings* thisPtr, Plane* value)
+	void ScriptParticleSystemSettings::Internal_setorientationPlaneNormal(ScriptParticleSystemSettings* thisPtr, Vector3* value)
 	{
-		thisPtr->getInternal()->orientationPlane = *value;
+		thisPtr->getInternal()->orientationPlaneNormal = *value;
 	}
 
 	ParticleSortMode ScriptParticleSystemSettings::Internal_getsortMode(ScriptParticleSystemSettings* thisPtr)

+ 3 - 3
Source/Scripting/SBansheeEngine/Generated/BsScriptParticleSystemSettings.generated.h

@@ -6,8 +6,8 @@
 #include "../../../bsf/Source/Foundation/bsfCore/Particles/BsParticleSystem.h"
 #include "../../../bsf/Source/Foundation/bsfCore/Particles/BsParticleSystem.h"
 #include "../../../bsf/Source/Foundation/bsfCore/Particles/BsParticleSystem.h"
+#include "Math/BsVector3.h"
 #include "../../../bsf/Source/Foundation/bsfCore/Particles/BsParticleSystem.h"
-#include "Math/BsPlane.h"
 
 namespace bs
 {
@@ -38,8 +38,8 @@ namespace bs
 		static void Internal_setorientation(ScriptParticleSystemSettings* thisPtr, ParticleOrientation value);
 		static bool Internal_getorientationLockY(ScriptParticleSystemSettings* thisPtr);
 		static void Internal_setorientationLockY(ScriptParticleSystemSettings* thisPtr, bool value);
-		static void Internal_getorientationPlane(ScriptParticleSystemSettings* thisPtr, Plane* __output);
-		static void Internal_setorientationPlane(ScriptParticleSystemSettings* thisPtr, Plane* value);
+		static void Internal_getorientationPlaneNormal(ScriptParticleSystemSettings* thisPtr, Vector3* __output);
+		static void Internal_setorientationPlaneNormal(ScriptParticleSystemSettings* thisPtr, Vector3* value);
 		static ParticleSortMode Internal_getsortMode(ScriptParticleSystemSettings* thisPtr);
 		static void Internal_setsortMode(ScriptParticleSystemSettings* thisPtr, ParticleSortMode value);
 		static float Internal_getduration(ScriptParticleSystemSettings* thisPtr);

+ 14 - 3
Source/Scripting/SBansheeEngine/Wrappers/BsScriptPixelUtility.cpp

@@ -25,7 +25,8 @@ namespace bs
 		metaData.scriptClass->addInternalCall("Internal_Compress", (void*)&ScriptPixelUtility::internal_compress);
 		metaData.scriptClass->addInternalCall("Internal_GenerateMipmaps", (void*)&ScriptPixelUtility::internal_generateMipmaps);
 		metaData.scriptClass->addInternalCall("Internal_Scale", (void*)&ScriptPixelUtility::internal_scale);
-		metaData.scriptClass->addInternalCall("Internal_ApplyGamma", (void*)&ScriptPixelUtility::internal_applyGamma);
+		metaData.scriptClass->addInternalCall("Internal_LinearToSRGB", (void*)&ScriptPixelUtility::internal_linearToSRGB);
+		metaData.scriptClass->addInternalCall("Internal_SRGBToLinear", (void*)&ScriptPixelUtility::internal_SRGBToLinear);
 	}
 
 	void ScriptPixelUtility::internal_getMemorySize(UINT32 width, UINT32 height, UINT32 depth, PixelFormat format, UINT32* value)
@@ -127,13 +128,23 @@ namespace bs
 		return ScriptPixelData::create(outputData);
 	}
 
-	void ScriptPixelUtility::internal_applyGamma(MonoObject* source, float gamma)
+	void ScriptPixelUtility::internal_linearToSRGB(MonoObject* source)
 	{
 		ScriptPixelData* sourceScriptPixelData = ScriptPixelData::toNative(source);
 		if (sourceScriptPixelData == nullptr)
 			return;
 
 		SPtr<PixelData> pixelData = sourceScriptPixelData->getInternal();
-		PixelUtil::applyGamma(pixelData->getData(), gamma, pixelData->getSize(), PixelUtil::getNumElemBits(pixelData->getFormat()));
+		PixelUtil::SRGBToLinear(*pixelData);
+	}
+
+	void ScriptPixelUtility::internal_SRGBToLinear(MonoObject* source)
+	{
+		ScriptPixelData* sourceScriptPixelData = ScriptPixelData::toNative(source);
+		if (sourceScriptPixelData == nullptr)
+			return;
+
+		SPtr<PixelData> pixelData = sourceScriptPixelData->getInternal();
+		PixelUtil::SRGBToLinear(*pixelData);
 	}
 }

+ 2 - 1
Source/Scripting/SBansheeEngine/Wrappers/BsScriptPixelUtility.h

@@ -35,7 +35,8 @@ namespace bs
 		static MonoObject* internal_compress(MonoObject* source, CompressionOptions* options);
 		static MonoArray* internal_generateMipmaps(MonoObject* source, MipMapGenOptions* options);
 		static MonoObject* internal_scale(MonoObject* source, PixelVolume* newSize, PixelUtil::Filter filter);
-		static void internal_applyGamma(MonoObject* source, float gamma);
+		static void internal_linearToSRGB(MonoObject* source);
+		static void internal_SRGBToLinear(MonoObject* source);
 	};
 
 	/** @} */

+ 1 - 1
Source/bsf

@@ -1 +1 @@
-Subproject commit 8095f094cbc6d6e734808b564100bbcb18bde403
+Subproject commit c46bcf338aec6a3d488d926e9d86492caaf28950