Przeglądaj źródła

WIP: Linux port
- Getting Windows back up to date after Linux changes:
- In-editor C# compilation on Windows now works again
- Fixed a crash caused by freeing a managed GC handle twice in SceneObject
- Fixed compile issues with Windows-specific OpenGL code

BearishSun 8 lat temu
rodzic
commit
e296bff3fd

+ 5 - 0
Source/BansheeEditor/Library/BsProjectLibrary.cpp

@@ -596,7 +596,12 @@ namespace bs
 		WString replace(L"\\\\&");
 		WString escapedPattern = std::regex_replace(pattern, escape, replace, std::regex_constants::match_default | std::regex_constants::format_sed);
 
+		// For some reason MSVC stdlib implementation requires a different pattern than stdlib one
+#if BS_PLATFORM == BS_PLATFORM_WIN32
+		std::wregex wildcard(L"\\\\\\*");
+#else
 		std::wregex wildcard(L"\\\\\\\\\\*");
+#endif
 		WString wildcardReplace(L".*");
 		WString searchPattern = std::regex_replace(escapedPattern, wildcard, L".*");
 

+ 1 - 1
Source/BansheeEngine/Utility/BsPaths.cpp

@@ -61,7 +61,7 @@ namespace bs
 			Path anchorFile = path;
 			anchorFile.setFilename("BansheeEngine" + String(DynLib::EXTENSION));
 
-			if (!FileSystem::exists(path))
+			if (!FileSystem::exists(anchorFile))
 			{
 				path = BINARIES_PATH;
 				if (!FileSystem::exists(path))

+ 0 - 1
Source/BansheeGLRenderAPI/Win32/BsWin32GLSupport.cpp

@@ -126,7 +126,6 @@ namespace bs { namespace ct
 		}
 		else
 		{
-			rapi->_getMainContext()->setCurrent();
 			glrc = wglGetCurrentContext();
 		}
 

+ 2 - 1
Source/BansheeGLRenderAPI/Win32/BsWin32RenderWindow.cpp

@@ -32,7 +32,6 @@ namespace bs
 
 	Win32RenderWindow::~Win32RenderWindow()
 	{
-		Platform::resetNonClientAreas(*this);
 	}
 
 	void Win32RenderWindow::getCustomAttribute(const String& name, void* pData) const
@@ -109,6 +108,8 @@ namespace bs
 			bs_free(mDeviceName);
 			mDeviceName = nullptr;
 		}
+
+		Platform::resetNonClientAreas(*this);
 	}
 
 	void Win32RenderWindow::initialize()

+ 5 - 2
Source/SBansheeEngine/Wrappers/BsScriptSceneObject.cpp

@@ -405,8 +405,11 @@ namespace bs
 			ScriptGameObjectManager::instance().destroyScriptSceneObject(this);
 		else
 		{
-			MonoUtil::freeGCHandle(mManagedHandle);
-			mManagedHandle = 0;
+			if (mManagedHandle != 0)
+			{
+				MonoUtil::freeGCHandle(mManagedHandle);
+				mManagedHandle = 0;
+			}
 		}
 	}