Răsfoiți Sursa

More work on clang compilation
Fixes for C# Radian/Degree casting

BearishSun 9 ani în urmă
părinte
comite
480492a312
50 a modificat fișierele cu 223 adăugiri și 66 ștergeri
  1. 1 0
      BansheeCore/Include/BsCColliderRTTI.h
  2. 1 0
      BansheeCore/Include/BsCJointRTTI.h
  3. 1 0
      BansheeCore/Include/BsComponentRTTI.h
  4. 1 0
      BansheeCore/Include/BsGameObjectRTTI.h
  5. 1 0
      BansheeCore/Include/BsGpuResourceDataRTTI.h
  6. 1 0
      BansheeCore/Include/BsMeshBaseRTTI.h
  7. 1 0
      BansheeCore/Include/BsResourceRTTI.h
  8. 1 0
      BansheeCore/Source/BsPhysicsMeshRTTI.h
  9. 1 0
      BansheeCore/Source/BsPixelBuffer.cpp
  10. 2 0
      BansheeCore/Source/BsPixelUtil.cpp
  11. 9 0
      BansheeCore/Source/BsShader.cpp
  12. 1 0
      BansheeCore/Source/BsStringTable.cpp
  13. 1 0
      BansheeCore/Source/BsVertexDeclaration.cpp
  14. 1 0
      BansheeD3D11RenderAPI/Source/BsD3D11DriverList.cpp
  15. 1 0
      BansheeD3D11RenderAPI/Source/BsD3D11Mappings.cpp
  16. 1 0
      BansheeD3D11RenderAPI/Source/BsD3D11RasterizerState.cpp
  17. 1 0
      BansheeD3D11RenderAPI/Source/BsD3D11RenderWindow.cpp
  18. 1 1
      BansheeD3D11RenderAPI/Source/BsD3D11Texture.cpp
  19. 1 2
      BansheeD3D9RenderAPI/Source/BsD3D9RenderWindow.cpp
  20. 1 1
      BansheeD3D9RenderAPI/Source/BsD3D9VideoModeInfo.cpp
  21. 1 0
      BansheeEditor/Source/BsEditorApplication.cpp
  22. 1 1
      BansheeEngine/Source/BsDrawHelper.cpp
  23. 2 0
      BansheeEngine/Source/BsGUIElementContainer.cpp
  24. 2 0
      BansheeEngine/Source/BsGUIInputTool.cpp
  25. 1 0
      BansheeEngine/Source/BsGUIManager.cpp
  26. 2 0
      BansheeEngine/Source/BsGUIViewport.cpp
  27. 1 0
      BansheeGLRenderAPI/Source/BsGLPixelFormat.cpp
  28. 6 0
      BansheeGLRenderAPI/Source/BsGLRenderAPI.cpp
  29. 2 0
      BansheeGLRenderAPI/Source/BsGLSLParamParser.cpp
  30. 1 0
      BansheeGLRenderAPI/Source/win32/BsWin32RenderWindow.cpp
  31. 1 1
      BansheeUtility/Include/BsVector3.h
  32. 1 0
      BansheeUtility/Source/BsPlane.cpp
  33. 1 1
      MBansheeEditor/EditorSettings.cs
  34. 1 1
      MBansheeEditor/Inspectors/CameraInspector.cs
  35. 21 0
      MBansheeEditor/Inspectors/D6JointInspector.cs
  36. 2 2
      MBansheeEditor/Inspectors/LightInspector.cs
  37. 2 2
      MBansheeEditor/Scene/HandleSliderDisc.cs
  38. 1 1
      MBansheeEditor/Scene/Handles.cs
  39. 7 7
      MBansheeEditor/Scene/RotateHandle.cs
  40. 5 5
      MBansheeEditor/Scene/SceneCamera.cs
  41. 1 1
      MBansheeEditor/Scene/SceneWindow.cs
  42. 21 21
      MBansheeEngine/Math/MathEx.cs
  43. 13 13
      MBansheeEngine/Math/Matrix3.cs
  44. 4 4
      MBansheeEngine/Math/Quaternion.cs
  45. 10 0
      MBansheeEngine/Math/Radian.cs
  46. 2 2
      MBansheeEngine/NativeLight.cs
  47. 48 0
      MBansheeEngine/Physics/Joint.cs
  48. 1 0
      SBansheeEngine/Include/BsManagedSerializableFieldRTTI.h
  49. 1 0
      SBansheeEngine/Include/BsManagedSerializableObjectInfoRTTI.h
  50. 32 0
      SBansheeEngine/Source/BsManagedSerializableField.cpp

+ 1 - 0
BansheeCore/Include/BsCColliderRTTI.h

@@ -53,6 +53,7 @@ namespace BansheeEngine
 		std::shared_ptr<IReflectable> newRTTIObject() override
 		{
 			BS_EXCEPT(InternalErrorException, "Cannot instantiate an abstract class.");
+			return nullptr;
 		}
 	};
 

+ 1 - 0
BansheeCore/Include/BsCJointRTTI.h

@@ -56,6 +56,7 @@ namespace BansheeEngine
 		std::shared_ptr<IReflectable> newRTTIObject() override
 		{
 			BS_EXCEPT(InternalErrorException, "Cannot instantiate an abstract class.");
+			return nullptr;
 		}
 	};
 

+ 1 - 0
BansheeCore/Include/BsComponentRTTI.h

@@ -53,6 +53,7 @@ namespace BansheeEngine
 		std::shared_ptr<IReflectable> newRTTIObject() override
 		{
 			BS_EXCEPT(InternalErrorException, "Cannot instantiate an abstract class.");
+			return nullptr;
 		}
 	};
 

+ 1 - 0
BansheeCore/Include/BsGameObjectRTTI.h

@@ -90,6 +90,7 @@ namespace BansheeEngine
 		std::shared_ptr<IReflectable> newRTTIObject() override
 		{
 			BS_EXCEPT(InternalErrorException, "Cannot instantiate an abstract class.");
+			return nullptr;
 		}
 	};
 

+ 1 - 0
BansheeCore/Include/BsGpuResourceDataRTTI.h

@@ -33,6 +33,7 @@ namespace BansheeEngine
 		std::shared_ptr<IReflectable> newRTTIObject() override
 		{
 			BS_EXCEPT(InternalErrorException, "Cannot instantiate an abstract class.");
+			return nullptr;
 		}
 	};
 

+ 1 - 0
BansheeCore/Include/BsMeshBaseRTTI.h

@@ -43,6 +43,7 @@ namespace BansheeEngine
 		std::shared_ptr<IReflectable> newRTTIObject() override
 		{
 			BS_EXCEPT(InternalErrorException, "Cannot instantiate an abstract class.");
+			return nullptr;
 		}
 
 		const String& getRTTIName() override

+ 1 - 0
BansheeCore/Include/BsResourceRTTI.h

@@ -44,6 +44,7 @@ namespace BansheeEngine
 		std::shared_ptr<IReflectable> newRTTIObject() override
 		{
 			BS_EXCEPT(InternalErrorException, "Cannot instantiate an abstract class.");
+			return nullptr;
 		}
 	};
 

+ 1 - 0
BansheeCore/Source/BsPhysicsMeshRTTI.h

@@ -38,6 +38,7 @@ namespace BansheeEngine
 		std::shared_ptr<IReflectable> newRTTIObject() override
 		{
 			BS_EXCEPT(InternalErrorException, "Cannot instantiate an abstract class.");
+			return nullptr;
 		}
 	};
 

+ 1 - 0
BansheeCore/Source/BsPixelBuffer.cpp

@@ -43,6 +43,7 @@ namespace BansheeEngine
     void* PixelBuffer::lockImpl(UINT32 offset, UINT32 length, GpuLockOptions options)
     {
 		BS_EXCEPT(InternalErrorException, "lockImpl(offset,length) is not valid for PixelBuffers and should never be called");
+		return nullptr;
     }
 
 	void PixelBuffer::readData(UINT32 offset, UINT32 length, void* pDest)

+ 2 - 0
BansheeCore/Source/BsPixelUtil.cpp

@@ -1002,6 +1002,8 @@ namespace BansheeEngine
 		{
 			return width*height*depth*getNumElemBytes(format);
 		}
+
+		return 0;
 	}
 
 	void PixelUtil::getSizeForMipLevel(UINT32 width, UINT32 height, UINT32 depth, UINT32 mipLevel,

+ 9 - 0
BansheeCore/Source/BsShader.cpp

@@ -177,6 +177,7 @@ namespace BansheeEngine
 			return GPT_SAMPLER;
 
 		BS_EXCEPT(InternalErrorException, "Cannot find the parameter with the name: " + name);
+		return GPT_DATA;
 	}
 
 	template<bool Core>
@@ -187,6 +188,8 @@ namespace BansheeEngine
 			return findIterData->second;
 
 		BS_EXCEPT(InternalErrorException, "Cannot find the parameter with the name: " + name);
+		static SHADER_DATA_PARAM_DESC dummy;
+		return dummy;
 	}
 
 	template<bool Core>
@@ -197,6 +200,8 @@ namespace BansheeEngine
 			return findIterObject->second;
 
 		BS_EXCEPT(InternalErrorException, "Cannot find the parameter with the name: " + name);
+		static SHADER_OBJECT_PARAM_DESC dummy;
+		return dummy;
 	}
 
 	template<bool Core>
@@ -207,6 +212,8 @@ namespace BansheeEngine
 			return findIterObject->second;
 
 		BS_EXCEPT(InternalErrorException, "Cannot find the parameter with the name: " + name);
+		static SHADER_OBJECT_PARAM_DESC dummy;
+		return dummy;
 	}
 
 	template<bool Core>
@@ -217,6 +224,8 @@ namespace BansheeEngine
 			return findIterObject->second;
 
 		BS_EXCEPT(InternalErrorException, "Cannot find the parameter with the name: " + name);
+		static SHADER_OBJECT_PARAM_DESC dummy;
+		return dummy;
 	}
 
 	template<bool Core>

+ 1 - 0
BansheeCore/Source/BsStringTable.cpp

@@ -256,6 +256,7 @@ namespace BansheeEngine
 		}
 
 		BS_EXCEPT(InvalidParametersException, "There is no string data for the provided identifier.");
+		return nullptr;
 	}
 
 	HStringTable StringTable::create()

+ 1 - 0
BansheeCore/Source/BsVertexDeclaration.cpp

@@ -78,6 +78,7 @@ namespace BansheeEngine
 		}
 
 		BS_EXCEPT(InvalidParametersException, "Invalid type");
+		return 0;
 	}
 
 	VertexElementType VertexElement::getBestColorVertexElementType()

+ 1 - 0
BansheeD3D11RenderAPI/Source/BsD3D11DriverList.cpp

@@ -61,5 +61,6 @@ namespace BansheeEngine
 		}
 
 		BS_EXCEPT(InvalidParametersException, "Cannot find video mode with the specified name.");
+		return nullptr;
 	}
 }

+ 1 - 0
BansheeD3D11RenderAPI/Source/BsD3D11Mappings.cpp

@@ -858,5 +858,6 @@ namespace BansheeEngine
 		};
 
 		BS_EXCEPT(RenderingAPIException, "Invalid lock option. No DX11 equivalent of: " + toString(lockOptions));
+		return D3D11_MAP_WRITE;
 	}
 }

+ 1 - 0
BansheeD3D11RenderAPI/Source/BsD3D11RasterizerState.cpp

@@ -5,6 +5,7 @@
 #include "BsD3D11Device.h"
 #include "BsD3D11Mappings.h"
 #include "BsRenderStats.h"
+#include "BsMath.h"
 
 namespace BansheeEngine
 {

+ 1 - 0
BansheeD3D11RenderAPI/Source/BsD3D11RenderWindow.cpp

@@ -15,6 +15,7 @@
 #include "BsInput.h"
 #include "BsException.h"
 #include "BsRenderWindowManager.h"
+#include "BsMath.h"
 #include "Win32/BsWin32Window.h"
 
 namespace BansheeEngine

+ 1 - 1
BansheeD3D11RenderAPI/Source/BsD3D11Texture.cpp

@@ -9,7 +9,7 @@
 #include "BsException.h"
 #include "BsAsyncOp.h"
 #include "BsRenderStats.h"
-#include "BsDebug.h"
+#include "BsMath.h"
 
 namespace BansheeEngine
 {

+ 1 - 2
BansheeD3D9RenderAPI/Source/BsD3D9RenderWindow.cpp

@@ -7,10 +7,9 @@
 #include "BsException.h"
 #include "BsD3D9RenderAPI.h"
 #include "BsRenderAPI.h"
-#include "BsBitwise.h"
 #include "Win32/BsWin32Platform.h"
 #include "BsD3D9VideoModeInfo.h"
-#include "BsD3D9DeviceManager.h"
+#include "BsMath.h"
 #include "BsRenderWindowManager.h"
 #include "Win32/BsWin32Window.h"
 

+ 1 - 1
BansheeD3D9RenderAPI/Source/BsD3D9VideoModeInfo.cpp

@@ -2,7 +2,7 @@
 //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
 #include "BsD3D9VideoModeInfo.h"
 #include "BsD3D9RenderAPI.h"
-#include "BsException.h"
+#include "BsMath.h"
 
 namespace BansheeEngine
 {

+ 1 - 0
BansheeEditor/Source/BsEditorApplication.cpp

@@ -399,6 +399,7 @@ namespace BansheeEngine
 			return RenderAPIPlugin::OpenGL;
 
 		BS_EXCEPT(InvalidStateException, "Unsupported render API.");
+		return RenderAPIPlugin::DX11;
 	}
 
 	EditorApplication& gEditorApplication()

+ 1 - 1
BansheeEngine/Source/BsDrawHelper.cpp

@@ -143,7 +143,7 @@ namespace BansheeEngine
 		lineListData.color = mColor;
 		lineListData.transform = mTransform;
 		lineListData.layer = mLayer;
-		lineListData.center = center / (UINT32)lines.size();;
+		lineListData.center = center / (float)lines.size();;
 	}
 
 	void DrawHelper::frustum(const Vector3& position, float aspect, Degree FOV, float near, float far)

+ 2 - 0
BansheeEngine/Source/BsGUIElementContainer.cpp

@@ -20,6 +20,8 @@ namespace BansheeEngine
 	const SpriteMaterialInfo& GUIElementContainer::_getMaterial(UINT32 renderElementIdx) const
 	{
 		BS_EXCEPT(InvalidStateException, "Trying to retrieve a material from an element with no render elements.");
+		static SpriteMaterialInfo dummy;
+		return dummy;
 	}
 
 	UINT32 GUIElementContainer::_getNumQuads(UINT32 renderElementIdx) const

+ 2 - 0
BansheeEngine/Source/BsGUIInputTool.cpp

@@ -122,6 +122,7 @@ namespace BansheeEngine
 		}
 
 		BS_EXCEPT(InternalErrorException, "Invalid character index: " + toString(charIdx));
+		return Rect2I();
 	}
 
 	INT32 GUIInputTool::getCharIdxAtPos(const Vector2I& pos) const
@@ -198,6 +199,7 @@ namespace BansheeEngine
 		}
 
 		BS_EXCEPT(InternalErrorException, "Invalid character index: " + toString(charIdx));
+		return 0;
 	}
 
 	UINT32 GUIInputTool::getCharIdxAtInputIdx(UINT32 inputIdx) const

+ 1 - 0
BansheeEngine/Source/BsGUIManager.cpp

@@ -1541,6 +1541,7 @@ namespace BansheeEngine
 			return GUIMouseButton::Right;
 
 		BS_EXCEPT(InvalidParametersException, "Provided button is not a GUI supported mouse button.");
+		return GUIMouseButton::Left;
 	}
 
 	Vector2I GUIManager::getWidgetRelativePos(const GUIWidget* widget, const Vector2I& screenPos) const

+ 2 - 0
BansheeEngine/Source/BsGUIViewport.cpp

@@ -49,6 +49,8 @@ namespace BansheeEngine
 	const SpriteMaterialInfo& GUIViewport::_getMaterial(UINT32 renderElementIdx) const
 	{
 		BS_EXCEPT(InternalErrorException, "This element has no render element so no material can be retrieved.");
+		static SpriteMaterialInfo dummy;
+		return dummy;
 	}
 
 	UINT32 GUIViewport::_getNumQuads(UINT32 renderElementIdx) const

+ 1 - 0
BansheeGLRenderAPI/Source/BsGLPixelFormat.cpp

@@ -242,6 +242,7 @@ namespace BansheeEngine
 		}
 
 		BS_EXCEPT(InvalidParametersException, "Invalid depth stencil format");
+		return PF_D24S8;
 	}
 		
 	PixelFormat GLPixelUtil::getClosestEngineFormat(GLenum fmt)

+ 6 - 0
BansheeGLRenderAPI/Source/BsGLRenderAPI.cpp

@@ -1650,6 +1650,8 @@ namespace BansheeEngine
 		default:
 			BS_EXCEPT(InternalErrorException, "Invalid program type: " + toString(gptype));
 		}
+
+		return 0;
 	}
 
 	UINT32 GLRenderAPI::getGLUniformBlockBinding(GpuProgramType gptype, UINT32 binding)
@@ -1678,6 +1680,8 @@ namespace BansheeEngine
 		default:
 			BS_EXCEPT(InternalErrorException, "Invalid program type: " + toString(gptype));
 		}
+
+		return 0;
 	}
 
 	void GLRenderAPI::setActiveProgram(GpuProgramType gptype, const SPtr<GLSLGpuProgramCore>& program)
@@ -1724,6 +1728,8 @@ namespace BansheeEngine
 		default:
 			BS_EXCEPT(InvalidParametersException, "Insupported gpu program type: " + toString(gptype));
 		}
+
+		return nullptr;
 	}
 
 	void GLRenderAPI::initFromCaps(RenderAPICapabilities* caps)

+ 2 - 0
BansheeGLRenderAPI/Source/BsGLSLParamParser.cpp

@@ -71,6 +71,8 @@ namespace BansheeEngine
 		default:
 			BS_EXCEPT(NotImplementedException, "OpenGL render system currently only supports float parameters.");
 		}
+
+		return VET_FLOAT4;
 	}
 
 	bool GLSLParamParser::attribNameToElementSemantic(const String& name, VertexElementSemantic& semantic, UINT16& index)

+ 1 - 0
BansheeGLRenderAPI/Source/win32/BsWin32RenderWindow.cpp

@@ -16,6 +16,7 @@
 #include "BsGLPixelFormat.h"
 #include "BsRenderWindowManager.h"
 #include "Win32/BsWin32Window.h"
+#include "BsMath.h"
 
 GLenum GLEWAPIENTRY wglewContextInit(BansheeEngine::GLSupport *glSupport);
 

+ 1 - 1
BansheeUtility/Include/BsVector3.h

@@ -359,7 +359,7 @@ namespace BansheeEngine
 		}
 
 		/** Normalizes the provided vector and returns a new normalized instance. */
-		static inline Vector3 normalize(const Vector3& val);
+		static Vector3 normalize(const Vector3& val);
 
 		/** Calculates the cross-product of 2 vectors, i.e. the vector that lies perpendicular to them both. */
 		static Vector3 cross(const Vector3& a, const Vector3& b)

+ 1 - 0
BansheeUtility/Source/BsPlane.cpp

@@ -5,6 +5,7 @@
 #include "BsAABox.h"
 #include "BsSphere.h"
 #include "BsRay.h"
+#include "BsMath.h"
 
 namespace BansheeEngine 
 {

+ 1 - 1
MBansheeEditor/EditorSettings.cs

@@ -53,7 +53,7 @@ namespace BansheeEditor
         /// </summary>
         public static Degree RotateHandleSnapAmount
         {
-            get { return Internal_GetRotateHandleSnapAmount(); }
+            get { return (Degree)Internal_GetRotateHandleSnapAmount(); }
             set { Internal_SetRotateHandleSnapAmount(value.Degrees); }
         }
 

+ 1 - 1
MBansheeEditor/Inspectors/CameraInspector.cs

@@ -102,7 +102,7 @@ namespace BansheeEditor
                     ToggleTypeSpecificFields((ProjectionType)x);
                 };
 
-                fieldOfView.OnChanged += x => { camera.FieldOfView = x; MarkAsModified(); };
+                fieldOfView.OnChanged += x => { camera.FieldOfView = (Degree)x; MarkAsModified(); };
                 fieldOfView.OnFocusLost += ConfirmModify;
 
                 orthoHeight.OnChanged += x => { camera.OrthoHeight = x; MarkAsModified(); };

+ 21 - 0
MBansheeEditor/Inspectors/D6JointInspector.cs

@@ -126,6 +126,13 @@ namespace BansheeEditor
                 linearLimitLayout.AddSpace(10);
                 GUILayoutY linearLimitContentsLayout = linearLimitLayout.AddLayoutY();
                 limitLinearGUI = new LimitLinearGUI(joint.LimitLinear, linearLimitContentsLayout, Persistent);
+                limitLinearGUI.OnChanged += (x, y) =>
+                {
+                    joint.LimitLinear = new LimitLinear(x, y);
+
+                    MarkAsModified();
+                };
+                limitLinearGUI.OnConfirmed += ConfirmModify;
             }
 
             Layout.AddElement(twistLimitFoldout);
@@ -134,6 +141,13 @@ namespace BansheeEditor
                 twistLimitLayout.AddSpace(10);
                 GUILayoutY twistLimitContentsLayout = twistLimitLayout.AddLayoutY();
                 limitTwistGUI = new LimitAngularRangeGUI(joint.LimitTwist, twistLimitContentsLayout, Persistent);
+                limitTwistGUI.OnChanged += (x, y) =>
+                {
+                    joint.LimitTwist = new LimitAngularRange(x, y);
+
+                    MarkAsModified();
+                };
+                limitTwistGUI.OnConfirmed += ConfirmModify;
             }
 
             Layout.AddElement(swingLimitFoldout);
@@ -142,6 +156,13 @@ namespace BansheeEditor
                 swingLimitLayout.AddSpace(10);
                 GUILayoutY swingLimitContentsLayout = swingLimitLayout.AddLayoutY();
                 limitSwingGUI = new LimitConeRangeGUI(joint.LimitSwing, swingLimitContentsLayout, Persistent);
+                limitSwingGUI.OnChanged += (x, y) =>
+                {
+                    joint.LimitSwing = new LimitConeRange(x, y);
+
+                    MarkAsModified();
+                };
+                limitSwingGUI.OnConfirmed += ConfirmModify;
             }
 
             Layout.AddElement(driveFoldout);

+ 2 - 2
MBansheeEditor/Inspectors/LightInspector.cs

@@ -51,10 +51,10 @@ namespace BansheeEditor
                 intensityField.OnConfirmed += ConfirmModify;
                 intensityField.OnFocusLost += ConfirmModify;
 
-                spotAngleField.OnChanged += x => { light.SpotAngle = x; MarkAsModified(); };
+                spotAngleField.OnChanged += x => { light.SpotAngle = (Degree)x; MarkAsModified(); };
                 spotAngleField.OnFocusLost += ConfirmModify;
 
-                spotFalloffAngleField.OnChanged += x => { light.SpotFalloffAngle = x; MarkAsModified(); };
+                spotFalloffAngleField.OnChanged += x => { light.SpotFalloffAngle = (Degree)x; MarkAsModified(); };
                 spotFalloffAngleField.OnFocusLost += ConfirmModify;
 
                 castShadowField.OnChanged += x =>

+ 2 - 2
MBansheeEditor/Scene/HandleSliderDisc.cs

@@ -37,7 +37,7 @@ namespace BansheeEditor
             {
                 float value;
                 Internal_GetDelta(mCachedPtr, out value);
-                return value;
+                return (Degree)value;
             }
         }
 
@@ -50,7 +50,7 @@ namespace BansheeEditor
             {
                 float value;
                 Internal_GetStartAngle(mCachedPtr, out value);
-                return value;
+                return (Degree)value;
             }
         }
 

+ 1 - 1
MBansheeEditor/Scene/Handles.cs

@@ -72,7 +72,7 @@ namespace BansheeEditor
         /// <returns>Value snapped to the provided increments.</returns>
         public static Degree SnapValue(Degree value, Degree snapAmount)
         {
-            return SnapValue(value.Degrees, snapAmount.Degrees);
+            return (Degree)SnapValue(value.Degrees, snapAmount.Degrees);
         }
 
         /// <summary>

+ 7 - 7
MBansheeEditor/Scene/RotateHandle.cs

@@ -85,10 +85,10 @@ namespace BansheeEditor
                 dragStartRotation = Quaternion.Identity;
             }
 
-            Degree xValue = 0.0f;
-            Degree yValue = 0.0f;
-            Degree zValue = 0.0f;
-            Degree freeAxisValue = 0.0f;
+            Degree xValue = (Degree)0.0f;
+            Degree yValue = (Degree)0.0f;
+            Degree zValue = (Degree)0.0f;
+            Degree freeAxisValue = (Degree)0.0f;
 
             if (Handles.RotateHandleSnapActive)
             {
@@ -126,7 +126,7 @@ namespace BansheeEditor
             else
                 HandleDrawing.Color = Color.Red;
 
-            HandleDrawing.DrawWireArc(Vector3.Zero, Vector3.XAxis, 1.0f, GetXStartAngle(false), -180.0f, handleSize);
+            HandleDrawing.DrawWireArc(Vector3.Zero, Vector3.XAxis, 1.0f, GetXStartAngle(false), new Degree(-180.0f), handleSize);
 
             if (yAxis.State == HandleSlider.StateType.Active)
                 HandleDrawing.Color = Color.White;
@@ -135,7 +135,7 @@ namespace BansheeEditor
             else
                 HandleDrawing.Color = Color.Green;
 
-            HandleDrawing.DrawWireArc(Vector3.Zero, Vector3.YAxis, 1.0f, GetYStartAngle(false), -180.0f, handleSize);
+            HandleDrawing.DrawWireArc(Vector3.Zero, Vector3.YAxis, 1.0f, GetYStartAngle(false), new Degree(-180.0f), handleSize);
 
             if (zAxis.State == HandleSlider.StateType.Active)
                 HandleDrawing.Color = Color.White;
@@ -144,7 +144,7 @@ namespace BansheeEditor
             else
                 HandleDrawing.Color = Color.Blue;
 
-            HandleDrawing.DrawWireArc(Vector3.Zero, Vector3.ZAxis, 1.0f, GetZStartAngle(false), -180.0f, handleSize);
+            HandleDrawing.DrawWireArc(Vector3.Zero, Vector3.ZAxis, 1.0f, GetZStartAngle(false), new Degree(-180.0f), handleSize);
 
             // Draw "bounds" and free handle
             Color gray = new Color(1.0f, 1.0f, 1.0f, 0.3f);

+ 5 - 5
MBansheeEditor/Scene/SceneCamera.cs

@@ -31,7 +31,7 @@ namespace BansheeEditor
         private const float PanSpeed = 3.0f;
         private const float ScrollSpeed = 3.0f;
 	    private const float RotationalSpeed = 360.0f; // Degrees/second
-        private readonly Degree FieldOfView = 90.0f;
+        private readonly Degree FieldOfView = (Degree)90.0f;
         #endregion
 
         #region Fields
@@ -369,11 +369,11 @@ namespace BansheeEditor
             frustumWidth = animation.State.FrustumWidth;
 
             Vector3 eulerAngles = SceneObject.Rotation.ToEuler();
-            pitch = eulerAngles.x;
-            yaw = eulerAngles.y;
+            pitch = (Degree)eulerAngles.x;
+            yaw = (Degree)eulerAngles.y;
 
-            Degree FOV = (1.0f - animation.State.OrtographicPct)*FieldOfView;
-            if (FOV < 5.0f)
+            Degree FOV = (Degree)(1.0f - animation.State.OrtographicPct)*FieldOfView;
+            if (FOV < (Degree)5.0f)
             {
                 camera.ProjectionType = ProjectionType.Orthographic;
                 camera.OrthoHeight = frustumWidth * 0.5f / camera.AspectRatio;

+ 1 - 1
MBansheeEditor/Scene/SceneWindow.cs

@@ -659,7 +659,7 @@ namespace BansheeEditor
         /// <param name="value">Value that determines in what increments to perform rotate snapping.</param>
         private void OnRotateSnapValueChanged(float value)
         {
-            Handles.RotateSnapAmount = MathEx.Clamp(value, 0.01f, 360.0f);
+            Handles.RotateSnapAmount = (Degree)MathEx.Clamp(value, 0.01f, 360.0f);
             editorSettingsHash = EditorSettings.Hash;
         }
 

+ 21 - 21
MBansheeEngine/Math/MathEx.cs

@@ -25,27 +25,27 @@ namespace BansheeEngine
         /// <summary>
         /// Pi constant.
         /// </summary>
-        public const float Pi = 3.141593f;
+        public static readonly Radian Pi = new Radian(3.141593f);
 
         /// <summary>
         /// Two times pi constant.
         /// </summary>
-        public const float TwoPi = (2.0f * Pi);
+        public static readonly Radian TwoPi = new Radian(Pi * 2.0f);
 
         /// <summary>
         /// Half of pi constant.
         /// </summary>
-        public const float HalfPi = (0.5f * Pi);
+        public static readonly Radian HalfPi = new Radian(Pi * 0.5f);
 
         /// <summary>
         /// Constant that converts degrees to radians.
         /// </summary>
-        public const float Deg2Rad = Pi / 180.0f;
+        public static readonly float Deg2Rad = Pi.Radians / 180.0f;
 
         /// <summary>
         /// Constant that converts radians to degrees.
         /// </summary>
-        public const float Rad2Deg = 180.0f / Pi;
+        public static readonly float Rad2Deg = 180.0f / Pi.Radians;
 
         /// <summary>
         /// Returns the minimum value of the two provided.
@@ -364,9 +364,9 @@ namespace BansheeEngine
         /// </summary>
         /// <param name="f">Sine of an angle.</param>
         /// <returns>Angle in radians.</returns>
-        public static float Asin(float f)
+        public static Radian Asin(float f)
         {
-            return (float)Math.Asin(f);
+            return (Radian)Math.Asin(f);
         }
 
         /// <summary>
@@ -374,9 +374,9 @@ namespace BansheeEngine
         /// </summary>
         /// <param name="f">Cosine of an angle.</param>
         /// <returns>Angle in radians.</returns>
-        public static float Acos(float f)
+        public static Radian Acos(float f)
         {
-            return (float)Math.Acos(f);
+            return (Radian)Math.Acos(f);
         }
 
         /// <summary>
@@ -384,9 +384,9 @@ namespace BansheeEngine
         /// </summary>
         /// <param name="f">Tangent of an angle.</param>
         /// <returns>Angle in radians.</returns>
-        public static float Atan(float f)
+        public static Radian Atan(float f)
         {
-            return (float)Math.Atan(f);
+            return (Radian)Math.Atan(f);
         }
 
         /// <summary>
@@ -395,9 +395,9 @@ namespace BansheeEngine
         /// <param name="y">Y coordinate of the point.</param>
         /// <param name="x">X coordinate of the point.</param>
         /// <returns>Angle in radians in range [Pi, -Pi].</returns>
-        public static float Atan2(float y, float x)
+        public static Radian Atan2(float y, float x)
         {
-            return (float)Math.Atan2(y, x);
+            return (Radian)Math.Atan2(y, x);
         }
 
         /// <summary>
@@ -435,9 +435,9 @@ namespace BansheeEngine
         /// </summary>
         /// <param name="f">Sine of an angle.</param>
         /// <returns>Angle in radians.</returns>
-        public static float Asin(Radian f)
+        public static Radian Asin(Radian f)
         {
-            return (float)Math.Asin(f.Radians);
+            return (Radian)Math.Asin(f.Radians);
         }
 
         /// <summary>
@@ -445,9 +445,9 @@ namespace BansheeEngine
         /// </summary>
         /// <param name="f">Cosine of an angle.</param>
         /// <returns>Angle in radians.</returns>
-        public static float Acos(Radian f)
+        public static Radian Acos(Radian f)
         {
-            return (float)Math.Acos(f.Radians);
+            return (Radian)Math.Acos(f.Radians);
         }
 
         /// <summary>
@@ -455,9 +455,9 @@ namespace BansheeEngine
         /// </summary>
         /// <param name="f">Tangent of an angle.</param>
         /// <returns>Angle in radians.</returns>
-        public static float Atan(Radian f)
+        public static Radian Atan(Radian f)
         {
-            return (float)Math.Atan(f.Radians);
+            return (Radian)Math.Atan(f.Radians);
         }
 
         /// <summary>
@@ -466,9 +466,9 @@ namespace BansheeEngine
         /// <param name="y">Y coordinate of the point.</param>
         /// <param name="x">X coordinate of the point.</param>
         /// <returns>Angle in radians in range [Pi, -Pi].</returns>
-        public static float Atan2(Radian y, Radian x)
+        public static Radian Atan2(Radian y, Radian x)
         {
-            return (float)Math.Atan2(y.Radians, x.Radians);
+            return (Radian)Math.Atan2(y.Radians, x.Radians);
         }
 
         /// <summary>

+ 13 - 13
MBansheeEngine/Math/Matrix3.cs

@@ -384,34 +384,34 @@ namespace BansheeEngine
         /// <returns>Euler angles in degrees representing the rotation in this matrix.</returns>
         public Vector3 ToEulerAngles()
         {
-            float xAngle = -MathEx.Asin(this[1, 2]);
+            Radian xAngle = -MathEx.Asin(this[1, 2]);
 		    if (xAngle < MathEx.HalfPi)
 		    {
 			    if (xAngle > -MathEx.HalfPi)
 			    {
-				    float yAngle = MathEx.Atan2(this[0, 2], this[2, 2]);
-				    float zAngle = MathEx.Atan2(this[1, 0], this[1, 1]);
+				    Radian yAngle = MathEx.Atan2(this[0, 2], this[2, 2]);
+                    Radian zAngle = MathEx.Atan2(this[1, 0], this[1, 1]);
 
-                    return new Vector3(xAngle * MathEx.Rad2Deg, yAngle * MathEx.Rad2Deg, zAngle * MathEx.Rad2Deg);
+                    return new Vector3(xAngle.Degrees, yAngle.Degrees, zAngle.Degrees);
 			    }
 			    else
 			    {
 				    // Note: Not an unique solution.
 			        xAngle = -MathEx.HalfPi;
-                    float yAngle = MathEx.Atan2(-this[0, 1], this[0, 0]);
-				    float zAngle = 0.0f;
+                    Radian yAngle = MathEx.Atan2(-this[0, 1], this[0, 0]);
+				    Radian zAngle = (Radian)0.0f;
 				    
-                    return new Vector3(xAngle * MathEx.Rad2Deg, yAngle * MathEx.Rad2Deg, zAngle * MathEx.Rad2Deg);
+                    return new Vector3(xAngle.Degrees, yAngle.Degrees, zAngle.Degrees);
 			    }
 		    }
 		    else
 		    {
 			    // Note: Not an unique solution.
                 xAngle = MathEx.HalfPi;
-                float yAngle = MathEx.Atan2(this[0, 1], this[0, 0]);
-                float zAngle = 0.0f; 
+                Radian yAngle = MathEx.Atan2(this[0, 1], this[0, 0]);
+                Radian zAngle = (Radian)0.0f; 
 
-                return new Vector3(xAngle * MathEx.Rad2Deg, yAngle * MathEx.Rad2Deg, zAngle * MathEx.Rad2Deg);
+                return new Vector3(xAngle.Degrees, yAngle.Degrees, zAngle.Degrees);
 		    }
         }
 
@@ -433,10 +433,10 @@ namespace BansheeEngine
         {
             float trace = m00 + m11 + m22;
             float cos = 0.5f*(trace-1.0f);
-            Radian radians = MathEx.Acos(cos);  // In [0, PI]
-            angle = radians.Degrees;
+            Radian radians = (Radian)MathEx.Acos(cos);  // In [0, PI]
+            angle = radians;
 
-            if (radians > 0.0f)
+            if (radians > (Radian)0.0f)
             {
                 if (radians < MathEx.Pi)
                 {

+ 4 - 4
MBansheeEngine/Math/Quaternion.cs

@@ -414,7 +414,7 @@ namespace BansheeEngine
             if (MathEx.Abs(dot) < (1 - epsilon))
             {
                 float sin = MathEx.Sqrt(1 - (dot*dot));
-                float angle = MathEx.Atan2(sin, dot);
+                Radian angle = MathEx.Atan2(sin, dot);
                 float invSin = 1.0f / sin;
                 float a = MathEx.Sin((1.0f - t) * angle) * invSin;
                 float b = MathEx.Sin(t * angle) * invSin;
@@ -474,7 +474,7 @@ namespace BansheeEngine
 		    else
 		    {
 			    // Angle is 0, so any axis will do
-                angle = 0.0f;
+                angle = (Degree)0.0f;
 			    axis.x = 1.0f;
 			    axis.y = 0.0f;
 			    axis.z = 0.0f;
@@ -688,7 +688,7 @@ namespace BansheeEngine
         {
             Quaternion quat;
 
-            float halfAngle = (float)(0.5f*angle*MathEx.Deg2Rad);
+            float halfAngle = (float)(0.5f*angle.Radians);
             float sin = (float)MathEx.Sin(halfAngle);
             quat.w = (float)MathEx.Cos(halfAngle);
             quat.x = sin * axis.x;
@@ -768,7 +768,7 @@ namespace BansheeEngine
         /// <returns>Quaternion that can rotate an object to the specified angles.</returns>
         public static Quaternion FromEuler(Vector3 euler, EulerAngleOrder order = EulerAngleOrder.YXZ)
         {
-            return FromEuler(euler.x, euler.y, euler.z, order);
+            return FromEuler((Degree)euler.x, (Degree)euler.y, (Degree)euler.z, order);
         }
 
         /// <inheritdoc/>

+ 10 - 0
MBansheeEngine/Math/Radian.cs

@@ -117,6 +117,11 @@ namespace BansheeEngine
             return new Radian(a.value * s);
         }
 
+        public static Radian operator *(float s, Radian a)
+        {
+            return new Radian(a.value * s);
+        }
+
         public static Radian operator *(Radian a, Radian b)
         {
             return new Radian(a.value * b.value);
@@ -127,6 +132,11 @@ namespace BansheeEngine
             return new Radian(a.value / s);
         }
 
+        public static Radian operator /(float s, Radian a)
+        {
+            return new Radian(a.value / s);
+        }
+
         public static Radian operator /(Radian a, Radian b)
         {
             return new Radian(a.value / b.value);

+ 2 - 2
MBansheeEngine/NativeLight.cs

@@ -50,13 +50,13 @@ namespace BansheeEngine
 
         internal Degree SpotAngle
         {
-            get { return Internal_GetSpotAngle(mCachedPtr); }
+            get { return (Degree)Internal_GetSpotAngle(mCachedPtr); }
             set { Internal_SetSpotAngle(mCachedPtr, value.Degrees); }
         }
 
         internal Degree SpotFalloffAngle
         {
-            get { return Internal_GetSpotFalloffAngle(mCachedPtr); }
+            get { return (Degree)Internal_GetSpotFalloffAngle(mCachedPtr); }
             set { Internal_SetSpotFalloffAngle(mCachedPtr, value.Degrees); }
         }
 

+ 48 - 0
MBansheeEngine/Physics/Joint.cs

@@ -366,6 +366,12 @@ namespace BansheeEngine
             return false;
         }
 
+        /// <inheritdoc/>
+        public override int GetHashCode()
+        {
+            return base.GetHashCode();
+        }
+
         public static bool operator ==(Spring a, Spring b)
         {
             return a.Equals(b);
@@ -560,6 +566,12 @@ namespace BansheeEngine
             return false;
         }
 
+        /// <inheritdoc/>
+        public override int GetHashCode()
+        {
+            return base.GetHashCode();
+        }
+
         public static bool operator ==(D6JointDrive a, D6JointDrive b)
         {
             return a.Equals(b);
@@ -656,6 +668,12 @@ namespace BansheeEngine
             return false;
         }
 
+        /// <inheritdoc/>
+        public override int GetHashCode()
+        {
+            return base.GetHashCode();
+        }
+
         public static bool operator ==(HingeJointDrive a, HingeJointDrive b)
         {
             return a.Equals(b);
@@ -740,6 +758,12 @@ namespace BansheeEngine
             return false;
         }
 
+        /// <inheritdoc/>
+        public override int GetHashCode()
+        {
+            return base.GetHashCode();
+        }
+
         public static bool operator ==(LimitCommon a, LimitCommon b)
         {
             return a.Equals(b);
@@ -834,6 +858,12 @@ namespace BansheeEngine
             return false;
         }
 
+        /// <inheritdoc/>
+        public override int GetHashCode()
+        {
+            return base.GetHashCode();
+        }
+
         public static bool operator ==(LimitLinearRange a, LimitLinearRange b)
         {
             return a.Equals(b);
@@ -932,6 +962,12 @@ namespace BansheeEngine
             return false;
         }
 
+        /// <inheritdoc/>
+        public override int GetHashCode()
+        {
+            return base.GetHashCode();
+        }
+
         public static bool operator ==(LimitLinear a, LimitLinear b)
         {
             return a.Equals(b);
@@ -1038,6 +1074,12 @@ namespace BansheeEngine
             return false;
         }
 
+        /// <inheritdoc/>
+        public override int GetHashCode()
+        {
+            return base.GetHashCode();
+        }
+
         public static bool operator ==(LimitAngularRange a, LimitAngularRange b)
         {
             return a.Equals(b);
@@ -1148,6 +1190,12 @@ namespace BansheeEngine
             return false;
         }
 
+        /// <inheritdoc/>
+        public override int GetHashCode()
+        {
+            return base.GetHashCode();
+        }
+
         public static bool operator ==(LimitConeRange a, LimitConeRange b)
         {
             return a.Equals(b);

+ 1 - 0
SBansheeEngine/Include/BsManagedSerializableFieldRTTI.h

@@ -66,6 +66,7 @@ namespace BansheeEngine
 		virtual std::shared_ptr<IReflectable> newRTTIObject() override
 		{
 			BS_EXCEPT(InvalidStateException, "Cannot instantiate an abstract class.");
+			return nullptr;
 		}
 	};
 

+ 1 - 0
SBansheeEngine/Include/BsManagedSerializableObjectInfoRTTI.h

@@ -239,6 +239,7 @@ namespace BansheeEngine
 		virtual std::shared_ptr<IReflectable> newRTTIObject() override
 		{
 			BS_EXCEPT(InvalidStateException, "Cannot instantiate an abstract class");
+			return nullptr;
 		}
 	};
 

+ 32 - 0
SBansheeEngine/Source/BsManagedSerializableField.cpp

@@ -382,6 +382,7 @@ namespace BansheeEngine
 		}
 
 		BS_EXCEPT(InvalidParametersException, "Requesting an invalid type in serializable field.");
+		return nullptr;
 	}
 
 	void* ManagedSerializableFieldDataChar::getValue(const ManagedSerializableTypeInfoPtr& typeInfo)
@@ -394,6 +395,7 @@ namespace BansheeEngine
 		}
 
 		BS_EXCEPT(InvalidParametersException, "Requesting an invalid type in serializable field.");
+		return nullptr;
 	}
 
 	void* ManagedSerializableFieldDataI8::getValue(const ManagedSerializableTypeInfoPtr& typeInfo)
@@ -406,6 +408,7 @@ namespace BansheeEngine
 		}
 
 		BS_EXCEPT(InvalidParametersException, "Requesting an invalid type in serializable field.");
+		return nullptr;
 	}
 
 	void* ManagedSerializableFieldDataU8::getValue(const ManagedSerializableTypeInfoPtr& typeInfo)
@@ -418,6 +421,7 @@ namespace BansheeEngine
 		}
 
 		BS_EXCEPT(InvalidParametersException, "Requesting an invalid type in serializable field.");
+		return nullptr;
 	}
 
 	void* ManagedSerializableFieldDataI16::getValue(const ManagedSerializableTypeInfoPtr& typeInfo)
@@ -430,6 +434,7 @@ namespace BansheeEngine
 		}
 
 		BS_EXCEPT(InvalidParametersException, "Requesting an invalid type in serializable field.");
+		return nullptr;
 	}
 
 	void* ManagedSerializableFieldDataU16::getValue(const ManagedSerializableTypeInfoPtr& typeInfo)
@@ -442,6 +447,7 @@ namespace BansheeEngine
 		}
 
 		BS_EXCEPT(InvalidParametersException, "Requesting an invalid type in serializable field.");
+		return nullptr;
 	}
 
 	void* ManagedSerializableFieldDataI32::getValue(const ManagedSerializableTypeInfoPtr& typeInfo)
@@ -454,6 +460,7 @@ namespace BansheeEngine
 		}
 
 		BS_EXCEPT(InvalidParametersException, "Requesting an invalid type in serializable field.");
+		return nullptr;
 	}
 
 	void* ManagedSerializableFieldDataU32::getValue(const ManagedSerializableTypeInfoPtr& typeInfo)
@@ -466,6 +473,7 @@ namespace BansheeEngine
 		}
 
 		BS_EXCEPT(InvalidParametersException, "Requesting an invalid type in serializable field.");
+		return nullptr;
 	}
 
 	void* ManagedSerializableFieldDataI64::getValue(const ManagedSerializableTypeInfoPtr& typeInfo)
@@ -478,6 +486,7 @@ namespace BansheeEngine
 		}
 
 		BS_EXCEPT(InvalidParametersException, "Requesting an invalid type in serializable field.");
+		return nullptr;
 	}
 
 	void* ManagedSerializableFieldDataU64::getValue(const ManagedSerializableTypeInfoPtr& typeInfo)
@@ -490,6 +499,7 @@ namespace BansheeEngine
 		}
 
 		BS_EXCEPT(InvalidParametersException, "Requesting an invalid type in serializable field.");
+		return nullptr;
 	}
 
 	void* ManagedSerializableFieldDataFloat::getValue(const ManagedSerializableTypeInfoPtr& typeInfo)
@@ -502,6 +512,7 @@ namespace BansheeEngine
 		}
 
 		BS_EXCEPT(InvalidParametersException, "Requesting an invalid type in serializable field.");
+		return nullptr;
 	}
 
 	void* ManagedSerializableFieldDataDouble::getValue(const ManagedSerializableTypeInfoPtr& typeInfo)
@@ -514,6 +525,7 @@ namespace BansheeEngine
 		}
 
 		BS_EXCEPT(InvalidParametersException, "Requesting an invalid type in serializable field.");
+		return nullptr;
 	}
 
 	void* ManagedSerializableFieldDataString::getValue(const ManagedSerializableTypeInfoPtr& typeInfo)
@@ -531,6 +543,7 @@ namespace BansheeEngine
 		}
 
 		BS_EXCEPT(InvalidParametersException, "Requesting an invalid type in serializable field.");
+		return nullptr;
 	}
 
 	void* ManagedSerializableFieldDataResourceRef::getValue(const ManagedSerializableTypeInfoPtr& typeInfo)
@@ -545,6 +558,7 @@ namespace BansheeEngine
 		}
 
 		BS_EXCEPT(InvalidParametersException, "Requesting an invalid type in serializable field.");
+		return nullptr;
 	}
 
 	void* ManagedSerializableFieldDataGameObjectRef::getValue(const ManagedSerializableTypeInfoPtr& typeInfo)
@@ -578,6 +592,7 @@ namespace BansheeEngine
 		}
 
 		BS_EXCEPT(InvalidParametersException, "Requesting an invalid type in serializable field.");
+		return nullptr;
 	}
 
 	void* ManagedSerializableFieldDataObject::getValue(const ManagedSerializableTypeInfoPtr& typeInfo)
@@ -603,6 +618,7 @@ namespace BansheeEngine
 		}
 
 		BS_EXCEPT(InvalidParametersException, "Requesting an invalid type in serializable field.");
+		return nullptr;
 	}
 
 	void* ManagedSerializableFieldDataArray::getValue(const ManagedSerializableTypeInfoPtr& typeInfo)
@@ -618,6 +634,7 @@ namespace BansheeEngine
 		}
 
 		BS_EXCEPT(InvalidParametersException, "Requesting an invalid type in serializable field.");
+		return nullptr;
 	}
 
 	void* ManagedSerializableFieldDataList::getValue(const ManagedSerializableTypeInfoPtr& typeInfo)
@@ -633,6 +650,7 @@ namespace BansheeEngine
 		}
 
 		BS_EXCEPT(InvalidParametersException, "Requesting an invalid type in serializable field.");
+		return nullptr;
 	}
 
 	void* ManagedSerializableFieldDataDictionary::getValue(const ManagedSerializableTypeInfoPtr& typeInfo)
@@ -648,6 +666,7 @@ namespace BansheeEngine
 		}
 
 		BS_EXCEPT(InvalidParametersException, "Requesting an invalid type in serializable field.");
+		return nullptr;
 	}
 
 	MonoObject* ManagedSerializableFieldDataBool::getValueBoxed(const ManagedSerializableTypeInfoPtr& typeInfo)
@@ -660,6 +679,7 @@ namespace BansheeEngine
 		}
 
 		BS_EXCEPT(InvalidParametersException, "Requesting an invalid type in serializable field.");
+		return nullptr;
 	}
 
 	MonoObject* ManagedSerializableFieldDataChar::getValueBoxed(const ManagedSerializableTypeInfoPtr& typeInfo)
@@ -672,6 +692,7 @@ namespace BansheeEngine
 		}
 
 		BS_EXCEPT(InvalidParametersException, "Requesting an invalid type in serializable field.");
+		return nullptr;
 	}
 
 	MonoObject* ManagedSerializableFieldDataI8::getValueBoxed(const ManagedSerializableTypeInfoPtr& typeInfo)
@@ -684,6 +705,7 @@ namespace BansheeEngine
 		}
 
 		BS_EXCEPT(InvalidParametersException, "Requesting an invalid type in serializable field.");
+		return nullptr;
 	}
 
 	MonoObject* ManagedSerializableFieldDataU8::getValueBoxed(const ManagedSerializableTypeInfoPtr& typeInfo)
@@ -696,6 +718,7 @@ namespace BansheeEngine
 		}
 
 		BS_EXCEPT(InvalidParametersException, "Requesting an invalid type in serializable field.");
+		return nullptr;
 	}
 
 	MonoObject* ManagedSerializableFieldDataI16::getValueBoxed(const ManagedSerializableTypeInfoPtr& typeInfo)
@@ -708,6 +731,7 @@ namespace BansheeEngine
 		}
 
 		BS_EXCEPT(InvalidParametersException, "Requesting an invalid type in serializable field.");
+		return nullptr;
 	}
 
 	MonoObject* ManagedSerializableFieldDataU16::getValueBoxed(const ManagedSerializableTypeInfoPtr& typeInfo)
@@ -720,6 +744,7 @@ namespace BansheeEngine
 		}
 
 		BS_EXCEPT(InvalidParametersException, "Requesting an invalid type in serializable field.");
+		return nullptr;
 	}
 
 	MonoObject* ManagedSerializableFieldDataI32::getValueBoxed(const ManagedSerializableTypeInfoPtr& typeInfo)
@@ -732,6 +757,7 @@ namespace BansheeEngine
 		}
 
 		BS_EXCEPT(InvalidParametersException, "Requesting an invalid type in serializable field.");
+		return nullptr;
 	}
 
 	MonoObject* ManagedSerializableFieldDataU32::getValueBoxed(const ManagedSerializableTypeInfoPtr& typeInfo)
@@ -744,6 +770,7 @@ namespace BansheeEngine
 		}
 
 		BS_EXCEPT(InvalidParametersException, "Requesting an invalid type in serializable field.");
+		return nullptr;
 	}
 
 	MonoObject* ManagedSerializableFieldDataI64::getValueBoxed(const ManagedSerializableTypeInfoPtr& typeInfo)
@@ -756,6 +783,7 @@ namespace BansheeEngine
 		}
 
 		BS_EXCEPT(InvalidParametersException, "Requesting an invalid type in serializable field.");
+		return nullptr;
 	}
 
 	MonoObject* ManagedSerializableFieldDataU64::getValueBoxed(const ManagedSerializableTypeInfoPtr& typeInfo)
@@ -768,6 +796,7 @@ namespace BansheeEngine
 		}
 
 		BS_EXCEPT(InvalidParametersException, "Requesting an invalid type in serializable field.");
+		return nullptr;
 	}
 
 	MonoObject* ManagedSerializableFieldDataFloat::getValueBoxed(const ManagedSerializableTypeInfoPtr& typeInfo)
@@ -780,6 +809,7 @@ namespace BansheeEngine
 		}
 
 		BS_EXCEPT(InvalidParametersException, "Requesting an invalid type in serializable field.");
+		return nullptr;
 	}
 
 	MonoObject* ManagedSerializableFieldDataDouble::getValueBoxed(const ManagedSerializableTypeInfoPtr& typeInfo)
@@ -792,6 +822,7 @@ namespace BansheeEngine
 		}
 
 		BS_EXCEPT(InvalidParametersException, "Requesting an invalid type in serializable field.");
+		return nullptr;
 	}
 
 	MonoObject* ManagedSerializableFieldDataString::getValueBoxed(const ManagedSerializableTypeInfoPtr& typeInfo)
@@ -822,6 +853,7 @@ namespace BansheeEngine
 		}
 
 		BS_EXCEPT(InvalidParametersException, "Requesting an invalid type in serializable field.");
+		return nullptr;
 	}
 
 	MonoObject* ManagedSerializableFieldDataArray::getValueBoxed(const ManagedSerializableTypeInfoPtr& typeInfo)