2
0
Эх сурвалжийг харах

WIP getting stuff to compile with clang

BearishSun 9 жил өмнө
parent
commit
bffc5fa818

+ 2 - 0
BansheeUtility/Include/BsDebug.h

@@ -27,6 +27,8 @@ namespace BansheeEngine
 	class BS_UTILITY_EXPORT Debug
 	{
 	public:
+		Debug() {}
+
 		/** Adds a log entry in the "Debug" channel. */
 		void logDebug(const String& msg);
 

+ 0 - 1
BansheeUtility/Include/BsException.h

@@ -181,7 +181,6 @@ namespace BansheeEngine
 	static_assert((std::is_base_of<BansheeEngine::Exception, type>::value), "Invalid exception type (" #type ") for BS_EXCEPT macro. It needs to derive from BansheeEngine::Exception."); \
 	gCrashHandler().reportCrash(#type, desc, __PRETTY_FUNCTION__, __FILE__, __LINE__); \
 	PlatformUtility::terminate(true); \
-	throw type(desc, __PRETTY_FUNCTION__, __FILE__, __LINE__); \
 	}
 #endif
 

+ 2 - 2
BansheeUtility/Include/BsMemoryAllocator.h

@@ -379,11 +379,11 @@ namespace BansheeEngine
 				return nullptr;
 
 			if (num > static_cast<size_t>(-1) / sizeof(T))
-				throw std::bad_array_new_length();
+				return nullptr; // Error
 
 			void* const pv = bs_alloc<Alloc>((UINT32)(num * sizeof(T)));
 			if (!pv)
-				throw std::bad_alloc();
+				return nullptr; // Error
 
 			return static_cast<T*>(pv);
 		}

+ 8 - 8
BansheeUtility/Include/BsRTTIPrerequisites.h

@@ -153,15 +153,15 @@ namespace BansheeEngine
 	 * 
 	 * @see		RTTIPlainType
 	 */
-#define BS_ALLOW_MEMCPY_SERIALIZATION(type)				\
-	template<> struct RTTIPlainType<##type##>			\
-	{	enum { id=0 }; enum { hasDynamicSize = 0 };		\
+#define BS_ALLOW_MEMCPY_SERIALIZATION(type)					\
+	template<> struct RTTIPlainType<type>					\
+	{	enum { id=0 }; enum { hasDynamicSize = 0 };			\
 	static void toMemory(const type& data, char* memory)	\
-	{ memcpy(memory, &data, sizeof(##type##)); }			\
-	static UINT32 fromMemory(##type##& data, char* memory)	\
-	{ memcpy(&data, memory, sizeof(##type##)); return sizeof(##type##); }			\
-	static UINT32 getDynamicSize(const type& data)		\
-	{ return sizeof(##type##); }				\
+	{ memcpy(memory, &data, sizeof(type)); }				\
+	static UINT32 fromMemory(type& data, char* memory)		\
+	{ memcpy(&data, memory, sizeof(type)); return sizeof(type); }	\
+	static UINT32 getDynamicSize(const type& data)			\
+	{ return sizeof(type); }								\
 	}; 
 
 	/** @cond SPECIALIZATIONS */

+ 8 - 8
BansheeUtility/Include/BsStringFormat.h

@@ -188,10 +188,10 @@ namespace BansheeEngine
 		template<class T> static std::string toString(const T& param) { return std::to_string(param); }
 
 		/**	Helper method that "converts" a narrow string to a narrow string (simply a pass through). */
-		template<> static std::string toString(const std::string& param) { return param; }
+		static std::string toString(const std::string& param) { return param; }
 
 		/**	Helper method that converts a Banshee narrow string to a standard narrow string. */
-		template<> static std::string toString(const String& param)
+		static std::string toString(const String& param)
 		{
 			return std::string(param.c_str());
 		}
@@ -200,19 +200,19 @@ namespace BansheeEngine
 		template<class T> static std::string toString(T* param) { static_assert("Invalid pointer type."); }
 
 		/**	Helper method that converts a narrow character array to a narrow string. */
-		template<> static std::string toString<const char>(const char* param) { return std::string(param); }
+		static std::string toString(const char* param) { return std::string(param); }
 
 		/**	Helper method that converts a narrow character array to a narrow string. */
-		template<> static std::string toString<char>(char* param) { return std::string(param); }
+		static std::string toString(char* param) { return std::string(param); }
 
 		/**	Helper method for converting any data type to a wide string. */
 		template<class T> static std::wstring toWString(const T& param) { return std::to_wstring(param); }
 
 		/**	Helper method that "converts" a wide string to a wide string (simply a pass through). */
-		template<> static std::wstring toWString<std::wstring>(const std::wstring& param) { return param; }
+		static std::wstring toWString(const std::wstring& param) { return param; }
 
 		/**	Helper method that converts a Banshee wide string to a standard wide string. */
-		template<> static std::wstring toWString<WString>(const WString& param)
+		static std::wstring toWString(const WString& param)
 		{
 			return std::wstring(param.c_str());
 		}
@@ -221,10 +221,10 @@ namespace BansheeEngine
 		template<class T> static std::wstring toWString(T* param) { static_assert("Invalid pointer type."); }
 
 		/**	Helper method that converts a wide character array to a wide string. */
-		template<> static std::wstring toWString<const wchar_t>(const wchar_t* param) { return std::wstring(param); }
+		static std::wstring toWString(const wchar_t* param) { return std::wstring(param); }
 
 		/**	Helper method that converts a wide character array to a wide string. */
-		template<> static std::wstring toWString<wchar_t>(wchar_t* param) { return std::wstring(param); }
+		static std::wstring toWString(wchar_t* param) { return std::wstring(param); }
 
 		/**
 		 * Converts all the provided parameters into string representations and populates the provided @p parameters array.

+ 2 - 2
BansheeUtility/Source/BsGlobalFrameAlloc.cpp

@@ -32,12 +32,12 @@ namespace BansheeEngine
 
 	inline BS_UTILITY_EXPORT void bs_frame_free(void* data)
 	{
-		gFrameAlloc().dealloc(data);
+		gFrameAlloc().dealloc((UINT8*)data);
 	}
 
 	inline BS_UTILITY_EXPORT void bs_frame_free_aligned(void* data)
 	{
-		gFrameAlloc().dealloc(data);
+		gFrameAlloc().dealloc((UINT8*)data);
 	}
 
 	inline BS_UTILITY_EXPORT void bs_frame_mark()

+ 0 - 3
MBansheeEditor/AboutBox.cs

@@ -1,8 +1,5 @@
 //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
 //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-using System;
-using System.Collections.Generic;
-using System.Linq;
 using BansheeEngine;
 
 namespace BansheeEditor

+ 1 - 1
MBansheeEditor/Scene/DrawGizmo.cs

@@ -17,7 +17,7 @@ namespace BansheeEditor
         ParentSelected = 0x02,
         /// <summary>Gizmo is only displayed when its scene object is not selected.</summary>
         NotSelected = 0x04,
-        /// <summary>Gizmo can be clicked on (selected).</summary>
+        /// <summary>Gizmo can be clicked on in scene view, which will select its scene object.</summary>
         Pickable = 0x08
     }
 

+ 1 - 1
SBansheeEditor/Include/BsScriptGizmoManager.h

@@ -16,7 +16,7 @@ namespace BansheeEngine
 		Selected = 0x01, /**< Gizmo is only displayed when its scene object is selected. */
 		ParentSelected = 0x02, /**< Gizmo is only displayed when its parent scene object is selected. */
 		NotSelected = 0x04, /**< Gizmo is only displayed when its scene object is not selected. */
-		Pickable = 0x08 /**< Gizmo can be clicked on (selected). */
+		Pickable = 0x08 /**< Gizmo can be clicked on in scene view, which will select its scene object. */
 	};
 
 	/**