Просмотр исходного кода

Fixing build so it doesn't rely on the working folder, so build paths outside of the standard path work
Removed third party license links from the About box, since those are now packaged separately

BearishSun 9 лет назад
Родитель
Сommit
ca53f86531

+ 2 - 2
Source/BansheeEditor/Include/BsBuiltinEditorResources.h

@@ -147,10 +147,10 @@ namespace BansheeEngine
 		/**	Returns text contained in the default "empty" C# script. */
 		WString getEmptyCSScriptCode() const;
 
-		/**	Returns path to the builtin shader include folder, relative to the working directory. */
+		/**	Returns absolute path to the builtin shader include folder. */
 		static Path getShaderIncludeFolder();
 
-		/**	Returns path to the default widget layout file, relative to the working directory. */
+		/**	Returns absolute path to the default widget layout file. */
 		static Path getDefaultWidgetLayoutPath();
 
 		static const String ObjectFieldStyleName;

+ 1 - 4
Source/BansheeEditor/Source/BsBuildManager.cpp

@@ -97,7 +97,6 @@ namespace BansheeEngine
 	{
 		// Use Data folder as an anchor to find where the root is
 		Path sourceRoot = Paths::getRuntimeDataPath();
-		sourceRoot.makeAbsolute(FileSystem::getWorkingDirectoryPath());
 
 		UINT32 numDataDirs = Paths::RUNTIME_DATA_PATH.getNumDirectories();
 		if (Paths::RUNTIME_DATA_PATH.isFile())
@@ -124,7 +123,7 @@ namespace BansheeEngine
 		}
 		case BuildFolder::NativeBinaries:
 		{
-			Path binariesPath = FileSystem::getWorkingDirectoryPath();
+			Path binariesPath = Paths::getBinariesPath();
 
 			return binariesPath.makeRelative(sourceRoot);
 		}
@@ -146,8 +145,6 @@ namespace BansheeEngine
 		case PlatformType::Windows:
 		{
 			Path output = Paths::getRuntimeDataPath() + "Binaries\\Win64\\Game.exe";
-			output.makeAbsolute(FileSystem::getWorkingDirectoryPath());
-
 			return output;
 		}
 		default:

+ 14 - 24
Source/BansheeEditor/Source/BsBuiltinEditorResources.cpp

@@ -310,9 +310,6 @@ namespace BansheeEngine
 
 		ResourceManifestPath = BuiltinDataFolder + "ResourceManifest.asset";
 
-		Path absoluteDataPath = FileSystem::getWorkingDirectoryPath();
-		absoluteDataPath.append(BuiltinDataFolder);
-
 		// Update from raw assets if needed
 #if BS_DEBUG_MODE
 		if (BuiltinResourcesHelper::checkForModifications(BuiltinRawDataFolder, BuiltinDataFolder + L"Timestamp.asset"))
@@ -323,10 +320,7 @@ namespace BansheeEngine
 			preprocess();
 			BuiltinResourcesHelper::writeTimestamp(BuiltinDataFolder + L"Timestamp.asset");
 
-			Path absoluteDataPath = FileSystem::getWorkingDirectoryPath();
-			absoluteDataPath.append(BuiltinDataFolder);
-
-			ResourceManifest::save(mResourceManifest, ResourceManifestPath, absoluteDataPath);
+			ResourceManifest::save(mResourceManifest, ResourceManifestPath, BuiltinDataFolder);
 		}
 #endif
 
@@ -334,7 +328,7 @@ namespace BansheeEngine
 		if (mResourceManifest == nullptr)
 		{
 			if (FileSystem::exists(ResourceManifestPath))
-				mResourceManifest = ResourceManifest::load(ResourceManifestPath, absoluteDataPath);
+				mResourceManifest = ResourceManifest::load(ResourceManifestPath, BuiltinDataFolder);
 
 			if (mResourceManifest == nullptr)
 				mResourceManifest = ResourceManifest::create("BuiltinResources");
@@ -372,6 +366,8 @@ namespace BansheeEngine
 
 	void BuiltinEditorResources::preprocess()
 	{
+		Resources::instance().unloadAllUnused();
+
 		BuiltinResourcesHelper::importAssets(EditorRawShaderIncludeFolder, EditorShaderIncludeFolder, mResourceManifest); // Hidden dependency: Includes must be imported before shaders
 		BuiltinResourcesHelper::importAssets(EditorRawShaderFolder, EditorShaderFolder, mResourceManifest);
 		BuiltinResourcesHelper::importAssets(EditorRawSkinFolder, EditorSkinFolder, mResourceManifest);
@@ -392,7 +388,7 @@ namespace BansheeEngine
 		// Generate & save GUI skin
 		{
 			SPtr<GUISkin> skin = generateGUISkin();
-			Path outputPath = FileSystem::getWorkingDirectoryPath() + BuiltinDataFolder + (GUISkinFile + L".asset");
+			Path outputPath = BuiltinDataFolder + (GUISkinFile + L".asset");
 
 			HResource skinResource;
 			if (FileSystem::exists(outputPath))
@@ -456,15 +452,15 @@ namespace BansheeEngine
 			HTexture tex32 = Texture::create(scaled32);
 			HTexture tex16 = Texture::create(scaled16);
 
-			Path outputPath48 = FileSystem::getWorkingDirectoryPath() + inputFolder + (iconName + L"48.asset");
+			Path outputPath48 = inputFolder + (iconName + L"48.asset");
 			Resources::instance().save(tex48, outputPath48, true);
 			manifest->registerResource(tex48.getUUID(), outputPath48);
 
-			Path outputPath32 = FileSystem::getWorkingDirectoryPath() + inputFolder + (iconName + L"32.asset");
+			Path outputPath32 = inputFolder + (iconName + L"32.asset");
 			Resources::instance().save(tex32, outputPath32, true);
 			manifest->registerResource(tex32.getUUID(), outputPath32);
 
-			Path outputPath16 = FileSystem::getWorkingDirectoryPath() + inputFolder + (iconName + L"16.asset");
+			Path outputPath16 = inputFolder + (iconName + L"16.asset");
 			Resources::instance().save(tex16, outputPath16, true);
 			manifest->registerResource(tex16.getUUID(), outputPath16);
 
@@ -476,14 +472,12 @@ namespace BansheeEngine
 	{
 		SPtr<GUISkin> skin = GUISkin::_createPtr();
 
-		Path defaultFontPath = FileSystem::getWorkingDirectoryPath();
-		defaultFontPath.append(BuiltinDataFolder);
+		Path defaultFontPath = BuiltinDataFolder;
 		defaultFontPath.append(DefaultFontFilename + L".asset");
 
 		HFont defaultFont = gResources().load<Font>(defaultFontPath);
 
-		Path defaultAAFontPath = FileSystem::getWorkingDirectoryPath();
-		defaultAAFontPath.append(BuiltinDataFolder);
+		Path defaultAAFontPath = BuiltinDataFolder;
 		defaultAAFontPath.append(DefaultAAFontFilename + L".asset");
 
 		HFont defaultAAFont = gResources().load<Font>(defaultAAFontPath);
@@ -1958,8 +1952,7 @@ namespace BansheeEngine
 
 	HSpriteTexture BuiltinEditorResources::getGUITexture(const WString& name) const
 	{
-		Path texturePath = FileSystem::getWorkingDirectoryPath();
-		texturePath.append(EditorSkinFolder);
+		Path texturePath = EditorSkinFolder;
 		texturePath.append(L"sprite_" + name + L".asset");
 
 		return gResources().load<SpriteTexture>(texturePath);
@@ -1967,8 +1960,7 @@ namespace BansheeEngine
 
 	HSpriteTexture BuiltinEditorResources::getGUIIcon(const WString& name) const
 	{
-		Path texturePath = FileSystem::getWorkingDirectoryPath();
-		texturePath.append(EditorIconFolder);
+		Path texturePath = EditorIconFolder;
 		texturePath.append(L"sprite_" + name + L".asset");
 
 		return gResources().load<SpriteTexture>(texturePath);
@@ -2351,8 +2343,7 @@ namespace BansheeEngine
 
 	WString BuiltinEditorResources::getEmptyShaderCode() const
 	{
-		Path filePath = FileSystem::getWorkingDirectoryPath();
-		filePath.append(BuiltinDataFolder);
+		Path filePath = BuiltinDataFolder;
 		filePath.append(EmptyShaderCodeFile);
 
 		SPtr<DataStream> fileStream = FileSystem::openFile(filePath);
@@ -2364,8 +2355,7 @@ namespace BansheeEngine
 
 	WString BuiltinEditorResources::getEmptyCSScriptCode() const
 	{
-		Path filePath = FileSystem::getWorkingDirectoryPath();
-		filePath.append(BuiltinDataFolder);
+		Path filePath = BuiltinDataFolder;
 		filePath.append(EmptyCSScriptCodeFile);
 
 		SPtr<DataStream> fileStream = FileSystem::openFile(filePath);

+ 6 - 9
Source/BansheeEditor/Source/BsEditorApplication.cpp

@@ -330,8 +330,7 @@ namespace BansheeEngine
 		if (!FileSystem::exists(internalResourcesDir))
 			FileSystem::createDir(internalResourcesDir);
 
-		Path defaultLayoutPath = FileSystem::getWorkingDirectoryPath();
-		defaultLayoutPath.append(BuiltinEditorResources::getDefaultWidgetLayoutPath());
+		Path defaultLayoutPath = BuiltinEditorResources::getDefaultWidgetLayoutPath();
 
 		if (FileSystem::exists(defaultLayoutPath))
 		{
@@ -342,12 +341,11 @@ namespace BansheeEngine
 
 	void EditorApplication::loadEditorSettings()
 	{
-		Path absoluteDataPath = FileSystem::getWorkingDirectoryPath();
-		absoluteDataPath.append(getEditorSettingsPath());
+		Path settingsPath = getEditorSettingsPath();
 
-		if (FileSystem::exists(absoluteDataPath))
+		if (FileSystem::exists(settingsPath))
 		{
-			FileDecoder fs(absoluteDataPath);
+			FileDecoder fs(settingsPath);
 			mEditorSettings = std::static_pointer_cast<EditorSettings>(fs.decode());
 		}
 		
@@ -360,10 +358,9 @@ namespace BansheeEngine
 		if (mEditorSettings == nullptr)
 			return;
 
-		Path absoluteDataPath = FileSystem::getWorkingDirectoryPath();
-		absoluteDataPath.append(getEditorSettingsPath());
+		Path settingsPath = getEditorSettingsPath();
 
-		FileEncoder fs(absoluteDataPath);
+		FileEncoder fs(settingsPath);
 		fs.encode(mEditorSettings.get());
 	}
 

+ 5 - 1
Source/BansheeEngine/CMakeLists.txt

@@ -13,7 +13,11 @@ include_directories(${BansheeEngine_INC})
 add_library(BansheeEngine SHARED ${BS_BANSHEEENGINE_SRC})
 
 # Defines
-target_compile_definitions(BansheeEngine PRIVATE -DBS_EXPORTS)
+target_compile_definitions(BansheeEngine PRIVATE 
+	-DBS_EXPORTS
+	$<$<CONFIG:Debug>:BS_CONFIG=BS_CONFIG_DEBUG>
+	$<$<CONFIG:OptimizedDebug>:BS_CONFIG=BS_CONFIG_OPTIMIZEDDEBUG>
+	$<$<CONFIG:Release>:BS_CONFIG=BS_CONFIG_RELEASE>)
 
 # Libraries
 ## Local libs

+ 2 - 2
Source/BansheeEngine/Include/BsBuiltinResources.h

@@ -109,10 +109,10 @@ namespace BansheeEngine
 		/**	Returns image data the Banshee Engine splash screen. */
 		static SPtr<PixelData> getSplashScreen();
 
-		/**	Returns path to the builtin shader include folder, relative to the working directory. */
+		/**	Returns absolute path to the builtin shader include folder. */
 		static Path getShaderIncludeFolder();
 
-		/**	Returns path to the builtin icons folder, relative to the working directory. */
+		/**	Returns absolute path to the builtin icons folder. */
 		static Path getIconFolder();
 
 		static const WString IconTextureName;

+ 9 - 6
Source/BansheeEngine/Include/BsPaths.h

@@ -19,24 +19,27 @@ namespace BansheeEngine
 	class BS_EXPORT Paths
 	{
 	public:
-		/**	Returns a path where the managed release assemblies are located. Relative to working directory. */
+		/**	Returns the absolute path where the managed release assemblies are located. */
 		static const Path& getReleaseAssemblyPath();
 
-		/**	Returns a path where the managed debug assemblies are located. Relative to working directory. */
+		/**	Returns the absolute path where the managed debug assemblies are located. */
 		static const Path& getDebugAssemblyPath();
 
-		/**	Returns a path where the builtin assets are located. Relative to working directory. */
+		/**	Returns the absolute path where the builtin assets are located. */
 		static const Path& getRuntimeDataPath();
 
-		/**	Returns a path where the builtin engine-specific assets are located. Relative to working directory. */
+		/**	Returns the absolute path where the builtin engine-specific assets are located. */
 		static const Path& getEngineDataPath();
 
-		/**	Returns a path to the game settings file used by editor-built executables. Relative to working directory. */
+		/**	Returns the absolute path to the game settings file used by editor-built executables. */
 		static const Path& getGameSettingsPath();
 
-		/**	Returns a path to the game resources folder used by editor-built executables. Relative to working directory. */
+		/**	Returns the absolute path to the game resources folder used by editor-built executables. */
 		static const Path& getGameResourcesPath();
 
+		/** Returns the absolute path where the engine binaries are located in. */
+		static const Path& getBinariesPath();
+
 		/**
 		 * Searches common locations for a specified path by querying if the file/directory exists and returns the found 
 		 * path.

+ 2 - 5
Source/BansheeEngine/Source/BsApplication.cpp

@@ -139,11 +139,8 @@ namespace BansheeEngine
 
 	Path Application::getBuiltinAssemblyFolder() const
 	{
-		Path releaseAssemblyFolder = FileSystem::getWorkingDirectoryPath();
-		releaseAssemblyFolder.append(Paths::getReleaseAssemblyPath());
-
-		Path debugAssemblyFolder = FileSystem::getWorkingDirectoryPath();
-		debugAssemblyFolder.append(Paths::getDebugAssemblyPath());
+		Path releaseAssemblyFolder = Paths::getReleaseAssemblyPath();
+		Path debugAssemblyFolder = Paths::getDebugAssemblyPath();
 
 #if BS_DEBUG_MODE == 0
 		if (FileSystem::exists(releaseAssemblyFolder))

+ 16 - 29
Source/BansheeEngine/Source/BsBuiltinResources.cpp

@@ -216,11 +216,8 @@ namespace BansheeEngine
 		ResourceManifestPath = mBuiltinDataFolder + "ResourceManifest.asset";
 
 		// Load manifest
-		Path absoluteDataPath = FileSystem::getWorkingDirectoryPath();
-		absoluteDataPath.append(mBuiltinDataFolder);
-
 		if (FileSystem::exists(ResourceManifestPath))
-			mResourceManifest = ResourceManifest::load(ResourceManifestPath, absoluteDataPath);
+			mResourceManifest = ResourceManifest::load(ResourceManifestPath, mBuiltinDataFolder);
 
 		if (mResourceManifest == nullptr)
 			mResourceManifest = ResourceManifest::create("BuiltinResources");
@@ -236,10 +233,7 @@ namespace BansheeEngine
 				preprocess();
 				BuiltinResourcesHelper::writeTimestamp(mBuiltinDataFolder + L"Timestamp.asset");
 
-				Path absoluteDataPath = FileSystem::getWorkingDirectoryPath();
-				absoluteDataPath.append(mBuiltinDataFolder);
-
-				ResourceManifest::save(mResourceManifest, ResourceManifestPath, absoluteDataPath);
+				ResourceManifest::save(mResourceManifest, ResourceManifestPath, mBuiltinDataFolder);
 			}
 		}
 #endif
@@ -314,8 +308,7 @@ namespace BansheeEngine
 		/* 								ICON		                     		*/
 		/************************************************************************/
 
-		Path iconPath = FileSystem::getWorkingDirectoryPath();
-		iconPath.append(mEngineIconFolder);
+		Path iconPath = mEngineIconFolder;
 		iconPath.append(IconTextureName + L".asset");
 
 		HTexture iconTex = gResources().load<Texture>(iconPath);
@@ -364,7 +357,7 @@ namespace BansheeEngine
 		// Generate & save GUI skin
 		{
 			SPtr<GUISkin> skin = generateGUISkin();
-			Path outputPath = FileSystem::getWorkingDirectoryPath() + mBuiltinDataFolder + (GUISkinFile + L".asset");
+			Path outputPath = mBuiltinDataFolder + (GUISkinFile + L".asset");
 
 			HResource skinResource;
 			if (FileSystem::exists(outputPath))
@@ -387,8 +380,7 @@ namespace BansheeEngine
 
 	SPtr<GUISkin> BuiltinResources::generateGUISkin()
 	{
-		Path fontPath = FileSystem::getWorkingDirectoryPath();
-		fontPath.append(mBuiltinDataFolder);
+		Path fontPath = mBuiltinDataFolder;
 		fontPath.append(DefaultFontFilename + L".asset");
 
 		HFont font = gResources().load<Font>(fontPath);
@@ -843,7 +835,7 @@ namespace BansheeEngine
 		SPtr<Texture> normalTexture = Texture::_createPtr(normalPixelData);
 
 		// Save all textures
-		Path outputDir = FileSystem::getWorkingDirectoryPath() + mEngineTextureFolder;
+		Path outputDir = mEngineTextureFolder;
 
 		auto saveTexture = [&](const Path& path, const SPtr<Texture>& texture)
 		{
@@ -922,7 +914,7 @@ namespace BansheeEngine
 		SPtr<Mesh> discMesh = Mesh::_createPtr(discMeshData);
 
 		// Save all meshes
-		Path outputDir = FileSystem::getWorkingDirectoryPath() + mEngineMeshFolder;
+		Path outputDir = mEngineMeshFolder;
 
 		auto saveMesh = [&](const Path& path, const SPtr<Mesh>& mesh)
 		{
@@ -957,8 +949,7 @@ namespace BansheeEngine
 
 	HSpriteTexture BuiltinResources::getSkinTexture(const WString& name)
 	{
-		Path texturePath = FileSystem::getWorkingDirectoryPath();
-		texturePath.append(mEngineSkinFolder);
+		Path texturePath = mEngineSkinFolder;
 		texturePath.append(L"sprite_" + name + L".asset");
 
 		return gResources().load<SpriteTexture>(texturePath);
@@ -975,8 +966,7 @@ namespace BansheeEngine
 
 	HTexture BuiltinResources::getCursorTexture(const WString& name)
 	{
-		Path cursorPath = FileSystem::getWorkingDirectoryPath();
-		cursorPath.append(mEngineCursorFolder);
+		Path cursorPath = mEngineCursorFolder;
 		cursorPath.append(name + L".asset");
 
 		return gResources().load<Texture>(cursorPath);
@@ -1067,8 +1057,7 @@ namespace BansheeEngine
 
 	HMesh BuiltinResources::getMesh(BuiltinMesh mesh) const
 	{
-		Path meshPath = FileSystem::getWorkingDirectoryPath();
-		meshPath.append(mEngineMeshFolder);
+		Path meshPath = mEngineMeshFolder;
 
 		switch (mesh)
 		{
@@ -1094,8 +1083,7 @@ namespace BansheeEngine
 
 	HTexture BuiltinResources::getTexture(BuiltinTexture type)
 	{
-		Path texturePath = FileSystem::getWorkingDirectoryPath();
-		texturePath.append(Paths::getEngineDataPath());
+		Path texturePath = Paths::getEngineDataPath();
 		texturePath.append(TextureFolder);
 
 		switch (type)
@@ -1195,8 +1183,7 @@ namespace BansheeEngine
 
 			for(auto& entry : resourcesToSave)
 			{
-				Path relativeOutputPath = outputFolder + entry.first;;
-				Path outputPath = FileSystem::getWorkingDirectoryPath() + relativeOutputPath;
+				Path outputPath = outputFolder + entry.first;;
 
 				HResource resource;
 				if (FileSystem::exists(outputPath))
@@ -1212,7 +1199,7 @@ namespace BansheeEngine
 					Resources::instance().save(resource, outputPath, true);
 					manifest->registerResource(resource.getUUID(), outputPath);
 
-					outputAssets.insert(relativeOutputPath);
+					outputAssets.insert(outputPath);
 				}
 			}
 			
@@ -1253,7 +1240,7 @@ namespace BansheeEngine
 		HFont font = Importer::instance().import<Font>(inputFile, fontImportOptions);
 
 		WString fontName = outputName;
-		Path outputPath = FileSystem::getWorkingDirectoryPath() + outputFolder + fontName;
+		Path outputPath = outputFolder + fontName;
 		outputPath.setFilename(outputPath.getWFilename() + L".asset");
 
 		Resources::instance().save(font, outputPath, true);
@@ -1264,7 +1251,7 @@ namespace BansheeEngine
 		{
 			SPtr<const FontBitmap> fontData = font->getBitmap(size);
 
-			Path texPageOutputPath = FileSystem::getWorkingDirectoryPath() + outputFolder;
+			Path texPageOutputPath = outputFolder;
 
 			UINT32 pageIdx = 0;
 			for (auto tex : fontData->texturePages)
@@ -1295,7 +1282,7 @@ namespace BansheeEngine
 
 		for (auto& filePath : filesToProcess)
 		{
-			Path outputPath = FileSystem::getWorkingDirectoryPath() + filePath;
+			Path outputPath = filePath;
 			outputPath.setFilename(L"sprite_" + outputPath.getWFilename());
 
 			HTexture source = gResources().load<Texture>(filePath);

+ 34 - 5
Source/BansheeEngine/Source/BsPaths.cpp

@@ -1,12 +1,12 @@
 //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
 //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
 #include "BsPrerequisites.h"
+#include "BsEngineConfig.h"
 #include "BsFileSystem.h"
+#include "BsDynLib.h"
 
 namespace BansheeEngine
 {
-	static const Path RAW_APP_ROOT = "..\\..\\..\\"; // Path to the application root when files haven't been packaged yet (e.g. running from debugger)
-
 	const Path Paths::RELEASE_ASSEMBLY_PATH = "bin\\Assemblies\\Release\\";
 	const Path Paths::DEBUG_ASSEMBLY_PATH = "bin\\Assemblies\\Debug\\";
 	const Path Paths::RUNTIME_DATA_PATH = "Data\\";
@@ -48,12 +48,41 @@ namespace BansheeEngine
 		return path;
 	}
 
-	Path Paths::findPath(const Path& path)
+	const Path& Paths::getBinariesPath()
 	{
-		if (FileSystem::exists(path))
-			return path;
+		static bool initialized = false;
+		static Path path;
+		
+		if(!initialized)
+		{
+			path = FileSystem::getWorkingDirectoryPath();
+			
+			// Look for BansheeEngine library to find the right path
+			Path anchorFile = path;
+			anchorFile.setFilename("BansheeEngine" + String(DynLib::EXTENSION));
+
+			if (!FileSystem::exists(path))
+			{
+				path = BINARIES_PATH;
+				if (!FileSystem::exists(path))
+					path = ""; // No path found, keep the default
+			}
+
+			initialized = true;
+		}
+
+		return path;
+	}
 
+	Path Paths::findPath(const Path& path)
+	{
 		Path output = path;
+		if (FileSystem::exists(path))
+		{
+			output.makeAbsolute(FileSystem::getWorkingDirectoryPath());
+			return output;
+		}
+		
 		output.makeAbsolute(RAW_APP_ROOT);
 		if (FileSystem::exists(output))
 			return output;

+ 2 - 8
Source/BansheeMono/Include/BsMonoManager.h

@@ -59,16 +59,10 @@ namespace BansheeEngine
 		 */
 		void loadScriptDomain();
 
-		/**
-		 * Returns the path of the folder where Mono framework assemblies are located. Path is relative to the application
-		 * executable.
-		 */
+		/** Returns the absolute path of the folder where Mono framework assemblies are located. */
 		Path getFrameworkAssembliesFolder() const;
 
-		/**
-		 * Returns the path to the Mono /etc folder that is required for initializing Mono. Path is relative to the
-		 * application executable.
-		 */
+		/** Returns the absolute path to the Mono /etc folder that is required for initializing Mono. */
 		Path getMonoEtcFolder() const;
 
 		/**	Returns the absolute path to the Mono compiler. */

+ 1 - 2
Source/BansheeMono/Source/BsMonoManager.cpp

@@ -336,8 +336,7 @@ namespace BansheeEngine
 
 	Path MonoManager::getCompilerPath() const
 	{
-		Path compilerPath = FileSystem::getWorkingDirectoryPath();
-		compilerPath.append(Paths::findPath(MONO_COMPILER_DIR));
+		Path compilerPath = Paths::findPath(MONO_COMPILER_DIR);
 
 #if BS_PLATFORM == BS_PLATFORM_WIN32
 		compilerPath.append("mcs.exe");

+ 1 - 1
Source/BansheeUtility/Include/BsDynLib.h

@@ -40,7 +40,7 @@ namespace BansheeEngine
     {
     public:
 		/** System-specific file extension for a dynamic library (e.g. "dll"). */
-		static const char* extension;
+		static const char* EXTENSION;
 
 		/** Constructs the dynamic library object and loads the library with the specified name. */
 		DynLib(const String& name);

+ 3 - 3
Source/BansheeUtility/Source/BsDynLib.cpp

@@ -20,11 +20,11 @@ namespace BansheeEngine
 {
 
 #if BS_PLATFORM == BS_PLATFORM_LINUX
-	const char* DynLib::extension = "so";
+	const char* DynLib::EXTENSION = "so";
 #elif BS_PLATFORM == BS_PLATFORM_OSX
-	const char* DynLib::extension = "dylib";
+	const char* DynLib::EXTENSION = "dylib";
 #elif BS_PLATFORM == BS_PLATFORM_WIN32
-	const char* DynLib::extension = "dll";
+	const char* DynLib::EXTENSION = "dll";
 #else
 #  error Unhandled platform
 #endif

+ 1 - 1
Source/BansheeUtility/Source/BsDynLibManager.cpp

@@ -14,7 +14,7 @@ namespace BansheeEngine
 		// Add the extension (.dll, .so, ...) if necessary.
 		String filename = name;
 		const UINT32 length = (UINT32)filename.length();
-		const String extension = String(".") + DynLib::extension;
+		const String extension = String(".") + DynLib::EXTENSION;
 		const UINT32 extLength = (UINT32)extension.length();
 		if (length <= extLength || filename.substr(length - extLength) != extension)
 			filename += extension;

+ 13 - 1
Source/CMake/BsEngineConfig.h.in

@@ -5,4 +5,16 @@
 #define BS_RENDER_API_MODULE "@RENDER_API_MODULE_LIB@"
 #define BS_AUDIO_MODULE "@AUDIO_MODULE_LIB@"
 #define BS_PHYSICS_MODULE "@PHYSICS_MODULE_LIB@"
-#define BS_INPUT_MODULE "@INPUT_MODULE_LIB@"
+#define BS_INPUT_MODULE "@INPUT_MODULE_LIB@"
+
+/** Path to the application root when files haven't been packaged yet (e.g. running from debugger). */
+static const char* RAW_APP_ROOT = "@PROJECT_SOURCE_DIR@/../"; 
+
+/** Path to the binaries when files haven't been packaged yet (e.g. running from debugger). */
+#if BS_CONFIG == BS_CONFIG_DEBUG
+static const char* BINARIES_PATH = "@CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG@";
+#elif BS_CONFIG == BS_CONFIG_OPTIMIZEDDEBUG
+static const char* BINARIES_PATH = "@CMAKE_RUNTIME_OUTPUT_DIRECTORY_OPTIMIZEDDEBUG@";
+#elif BS_CONFIG == BS_CONFIG_RELEASE
+static const char* BINARIES_PATH = "@CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE@";
+#endif

+ 1 - 2
Source/Game/Source/Main.cpp

@@ -131,8 +131,7 @@ void runApplication()
 	SPtr<ResourceManifest> manifest;
 	if (FileSystem::exists(resourceManifestPath))
 	{
-		Path resourceRoot = FileSystem::getWorkingDirectoryPath();
-		resourceRoot.append(resourcesPath);
+		Path resourceRoot = resourcesPath;
 		resourceRoot.makeParent(); // Remove /Resources entry, as we expect all resources to be relative to that path
 
 		manifest = ResourceManifest::load(resourceManifestPath, resourceRoot);

+ 10 - 11
Source/MBansheeEditor/Windows/AboutBox.cs

@@ -98,12 +98,16 @@ namespace BansheeEditor
             GUILayoutY thirdPartyLayout = mainLayout.AddLayoutY();
 
             CreateThirdPartyGUI(thirdPartyLayout, "Autodesk FBX SDK",
-                "http://usa.autodesk.com/adsk/servlet/pc/item?siteID=123112&id=10775847", "FBX_SDK_License.rtf");
-            CreateThirdPartyGUI(thirdPartyLayout, "FreeImage", "http://freeimage.sourceforge.net/", "freeimage-license.txt");
-            CreateThirdPartyGUI(thirdPartyLayout, "FreeType", "http://www.freetype.org/", "FTL.TXT");
-            CreateThirdPartyGUI(thirdPartyLayout, "Mono", "http://www.mono-project.com/", "Mono.txt");
+                "http://usa.autodesk.com/adsk/servlet/pc/item?siteID=123112&id=10775847");
+            CreateThirdPartyGUI(thirdPartyLayout, "FreeImage", "http://freeimage.sourceforge.net/");
+            CreateThirdPartyGUI(thirdPartyLayout, "FreeType", "http://www.freetype.org/");
+            CreateThirdPartyGUI(thirdPartyLayout, "Mono", "http://www.mono-project.com/");
             CreateThirdPartyGUI(thirdPartyLayout, "NVIDIA Texture Tools",
-                "https://github.com/castano/nvidia-texture-tools", "NVIDIATextureTools.txt");
+                "https://github.com/castano/nvidia-texture-tools");
+            CreateThirdPartyGUI(thirdPartyLayout, "libFLAC", "https://xiph.org/flac/");
+            CreateThirdPartyGUI(thirdPartyLayout, "libOgg", "https://www.xiph.org/ogg/");
+            CreateThirdPartyGUI(thirdPartyLayout, "libVorbis", "http://www.vorbis.com/");
+            CreateThirdPartyGUI(thirdPartyLayout, "OpenAL Soft", "http://kcat.strangesoft.net/openal.html");
 
             mainLayout.AddSpace(5);
             mainLayout.AddElement(noticesFoldout);
@@ -138,25 +142,20 @@ namespace BansheeEditor
             linkedInBtn.OnClick += () => { System.Diagnostics.Process.Start("http://hr.linkedin.com/in/markopintera"); };
         }
 
-        private void CreateThirdPartyGUI(GUILayoutY layout, string name, string webURL, string licenseFile)
+        private void CreateThirdPartyGUI(GUILayoutY layout, string name, string webURL)
         {
             GUILabel label = new GUILabel(new LocEdString(name), GUIOption.FixedWidth(150));
             GUIButton linkBtn = new GUIButton(new LocEdString("Website"), GUIOption.FixedWidth(50));
             GUIButton licenseBtn = new GUIButton(new LocEdString("License"), GUIOption.FixedWidth(50));
 
-            string licensePath = "..\\..\\..\\License\\Third Party\\" + licenseFile;
-
             GUILayoutX horzLayout = layout.AddLayoutX();
             horzLayout.AddSpace(10);
             horzLayout.AddElement(label);
             horzLayout.AddSpace(10);
             horzLayout.AddElement(linkBtn);
-            horzLayout.AddSpace(5);
-            horzLayout.AddElement(licenseBtn);
             horzLayout.AddSpace(10);
 
             linkBtn.OnClick += () => { System.Diagnostics.Process.Start(webURL); };
-            licenseBtn.OnClick += () => { System.Diagnostics.Process.Start(licensePath); };
         }
 
         private void CreateCollaboratorGUI(GUILayoutY layout, string name, string area)

+ 1 - 4
Source/SBansheeEditor/Source/BsScriptBuildManager.cpp

@@ -120,7 +120,6 @@ namespace BansheeEngine
 		if (folder == ScriptBuildFolder::FrameworkAssemblies)
 		{
 			Path assemblyFolder = MonoManager::instance().getFrameworkAssembliesFolder();
-			assemblyFolder.makeAbsolute(FileSystem::getWorkingDirectoryPath());
 
 			Path sourceFolder = BuildManager::instance().getBuildFolder(BuildFolder::SourceRoot, platform);
 			path = assemblyFolder.makeRelative(sourceFolder);
@@ -128,7 +127,6 @@ namespace BansheeEngine
 		else if (folder == ScriptBuildFolder::Mono)
 		{
 			Path monoEtcFolder = MonoManager::instance().getMonoEtcFolder();
-			monoEtcFolder.makeAbsolute(FileSystem::getWorkingDirectoryPath());
 
 			Path sourceFolder = BuildManager::instance().getBuildFolder(BuildFolder::SourceRoot, platform);
 			path = monoEtcFolder.makeRelative(sourceFolder);
@@ -370,8 +368,7 @@ namespace BansheeEngine
 		}
 
 		// Save icon
-		Path iconFolder = FileSystem::getWorkingDirectoryPath();
-		iconFolder.append(BuiltinResources::getIconFolder());
+		Path iconFolder = BuiltinResources::getIconFolder();
 
 		Path sourceRoot = BuildManager::instance().getBuildFolder(BuildFolder::SourceRoot, platformInfo->type);
 		iconFolder.makeRelative(sourceRoot);

+ 2 - 5
Source/SBansheeEditor/Source/BsScriptEditorApplication.cpp

@@ -165,16 +165,14 @@ namespace BansheeEngine
 
 	MonoString* ScriptEditorApplication::internal_GetBuiltinReleaseAssemblyPath()
 	{
-		Path releaseAssemblyFolder = FileSystem::getWorkingDirectoryPath();
-		releaseAssemblyFolder.append(Paths::getReleaseAssemblyPath());
+		Path releaseAssemblyFolder = Paths::getReleaseAssemblyPath();
 
 		return MonoUtil::wstringToMono(releaseAssemblyFolder.toWString());
 	}
 
 	MonoString* ScriptEditorApplication::internal_GetBuiltinDebugAssemblyPath()
 	{
-		Path debugAssemblyFolder = FileSystem::getWorkingDirectoryPath();
-		debugAssemblyFolder.append(Paths::getDebugAssemblyPath());
+		Path debugAssemblyFolder = Paths::getDebugAssemblyPath();
 
 		return MonoUtil::wstringToMono(debugAssemblyFolder.toWString());
 	}
@@ -189,7 +187,6 @@ namespace BansheeEngine
 	MonoString* ScriptEditorApplication::internal_GetFrameworkAssemblyPath()
 	{
 		Path assemblyFolder = MonoManager::instance().getFrameworkAssembliesFolder();
-		assemblyFolder.makeAbsolute(FileSystem::getWorkingDirectoryPath());
 
 		return MonoUtil::wstringToMono(assemblyFolder.toWString());
 	}