Przeglądaj źródła

WIP: Script bindings
- Ported Font, SpriteTexture and StringTable to automatic script binding generator (SBGen)

BearishSun 8 lat temu
rodzic
commit
1e21488060
80 zmienionych plików z 351 dodań i 1840 usunięć
  1. 16 2
      Source/BansheeCore/Localization/BsStringTable.cpp
  2. 28 7
      Source/BansheeCore/Localization/BsStringTable.h
  3. 1 1
      Source/BansheeCore/Localization/BsStringTableManager.cpp
  4. 28 9
      Source/BansheeCore/Localization/BsStringTableManager.h
  5. 11 16
      Source/BansheeCore/RTTI/BsFontRTTI.h
  6. 6 6
      Source/BansheeCore/Text/BsFont.cpp
  7. 45 16
      Source/BansheeCore/Text/BsFont.h
  8. 6 64
      Source/BansheeCore/Text/BsFontDesc.h
  9. 20 20
      Source/BansheeCore/Text/BsTextData.cpp
  10. 8 8
      Source/BansheeCore/Text/BsTextData.h
  11. 23 26
      Source/BansheeEngine/2D/BsSpriteTexture.h
  12. 1 1
      Source/BansheeEngine/GUI/BsGUIInputCaret.cpp
  13. 1 1
      Source/BansheeFontImporter/BsFontImporter.cpp
  14. 1 1
      Source/CMakeLists.txt
  15. 5 5
      Source/MBansheeEditor/Inspectors/StringTableInspector.cs
  16. 18 7
      Source/MBansheeEditor/Windows/Library/ImportOptions.cs
  17. 1 1
      Source/MBansheeEngine/GUI/ContextMenu.cs
  18. 0 206
      Source/MBansheeEngine/GUI/Font.cs
  19. 1 1
      Source/MBansheeEngine/GUI/GUI.cs
  20. 1 1
      Source/MBansheeEngine/GUI/GUIButton.cs
  21. 1 1
      Source/MBansheeEngine/GUI/GUICanvas.cs
  22. 28 28
      Source/MBansheeEngine/GUI/GUIContent.cs
  23. 1 1
      Source/MBansheeEngine/GUI/GUIElement.cs
  24. 1 1
      Source/MBansheeEngine/GUI/GUIElementStateStyle.cs
  25. 15 15
      Source/MBansheeEngine/GUI/GUIElementStyle.cs
  26. 1 1
      Source/MBansheeEngine/GUI/GUILabel.cs
  27. 1 1
      Source/MBansheeEngine/GUI/GUILayout.cs
  28. 1 1
      Source/MBansheeEngine/GUI/GUILayoutX.cs
  29. 1 1
      Source/MBansheeEngine/GUI/GUILayoutY.cs
  30. 1 1
      Source/MBansheeEngine/GUI/GUIListBox.cs
  31. 1 1
      Source/MBansheeEngine/GUI/GUIListView.cs
  32. 1 1
      Source/MBansheeEngine/GUI/GUIOption.cs
  33. 1 1
      Source/MBansheeEngine/GUI/GUIPanel.cs
  34. 1 1
      Source/MBansheeEngine/GUI/GUIProgressBar.cs
  35. 1 1
      Source/MBansheeEngine/GUI/GUIRenderTexture.cs
  36. 6 6
      Source/MBansheeEngine/GUI/GUIScrollArea.cs
  37. 1 1
      Source/MBansheeEngine/GUI/GUIScrollBar.cs
  38. 1 1
      Source/MBansheeEngine/GUI/GUISkin.cs
  39. 1 1
      Source/MBansheeEngine/GUI/GUISlider.cs
  40. 1 1
      Source/MBansheeEngine/GUI/GUISpace.cs
  41. 1 1
      Source/MBansheeEngine/GUI/GUITextBox.cs
  42. 7 7
      Source/MBansheeEngine/GUI/GUITexture.cs
  43. 1 1
      Source/MBansheeEngine/GUI/GUIToggle.cs
  44. 1 1
      Source/MBansheeEngine/GUI/GUIToggleGroup.cs
  45. 1 1
      Source/MBansheeEngine/GUI/GUIUtility.cs
  46. 1 1
      Source/MBansheeEngine/GUI/GUIWidget.cs
  47. 1 1
      Source/MBansheeEngine/GUI/LocString.cs
  48. 1 1
      Source/MBansheeEngine/GUI/ShortcutKey.cs
  49. 0 128
      Source/MBansheeEngine/GUI/SpriteTexture.cs
  50. 0 141
      Source/MBansheeEngine/GUI/StringTable.cs
  51. 0 272
      Source/MBansheeEngine/GUI/StringTables.cs
  52. 1 1
      Source/MBansheeEngine/Interop/Program.cs
  53. 0 4
      Source/MBansheeEngine/MBansheeEngine.csproj
  54. 8 14
      Source/SBansheeEditor/Wrappers/BsScriptEditorBuiltin.cpp
  55. 2 2
      Source/SBansheeEditor/Wrappers/BsScriptGizmos.cpp
  56. 2 1
      Source/SBansheeEditor/Wrappers/BsScriptHandleDrawing.cpp
  57. 8 1
      Source/SBansheeEditor/Wrappers/BsScriptImportOptions.cpp
  58. 10 0
      Source/SBansheeEditor/Wrappers/BsScriptImportOptions.h
  59. 0 59
      Source/SBansheeEngine/BsScriptStringTableManager.cpp
  60. 0 37
      Source/SBansheeEngine/BsScriptStringTableManager.h
  61. 0 10
      Source/SBansheeEngine/CMakeSources.cmake
  62. 0 1
      Source/SBansheeEngine/Serialization/BsManagedSerializableField.cpp
  63. 3 5
      Source/SBansheeEngine/Serialization/BsScriptAssemblyManager.cpp
  64. 3 2
      Source/SBansheeEngine/Wrappers/BsScriptBuiltin.cpp
  65. 0 54
      Source/SBansheeEngine/Wrappers/BsScriptFont.cpp
  66. 0 48
      Source/SBansheeEngine/Wrappers/BsScriptFont.h
  67. 0 124
      Source/SBansheeEngine/Wrappers/BsScriptFontBitmap.cpp
  68. 0 75
      Source/SBansheeEngine/Wrappers/BsScriptFontBitmap.h
  69. 2 1
      Source/SBansheeEngine/Wrappers/BsScriptGUIContentImages.cpp
  70. 0 147
      Source/SBansheeEngine/Wrappers/BsScriptSpriteTexture.cpp
  71. 0 48
      Source/SBansheeEngine/Wrappers/BsScriptSpriteTexture.h
  72. 0 124
      Source/SBansheeEngine/Wrappers/BsScriptStringTable.cpp
  73. 0 52
      Source/SBansheeEngine/Wrappers/BsScriptStringTable.h
  74. 3 2
      Source/SBansheeEngine/Wrappers/GUI/BsScriptGUICanvas.cpp
  75. 0 1
      Source/SBansheeEngine/Wrappers/GUI/BsScriptGUIContent.cpp
  76. 2 1
      Source/SBansheeEngine/Wrappers/GUI/BsScriptGUIElementStateStyle.cpp
  77. 2 1
      Source/SBansheeEngine/Wrappers/GUI/BsScriptGUIElementStyle.cpp
  78. 0 3
      Source/SBansheeEngine/Wrappers/GUI/BsScriptGUIScrollArea.cpp
  79. 2 1
      Source/SBansheeEngine/Wrappers/GUI/BsScriptGUITexture.cpp
  80. 2 1
      Source/SBansheeEngine/Wrappers/GUI/BsScriptGUIUtility.cpp

+ 16 - 2
Source/BansheeCore/Localization/BsStringTable.cpp

@@ -187,7 +187,21 @@ namespace bs
 		mActiveLanguage = language;
 	}
 
-	void StringTable::setString(const WString& identifier, Language language, const WString& string)
+	bool StringTable::contains(const WString& identifier)
+	{
+		return mIdentifiers.find(identifier) == mIdentifiers.end();
+	}
+
+	Vector<WString> StringTable::getIdentifiers() const
+	{
+		Vector<WString> output;
+		for (auto& entry : mIdentifiers)
+			output.push_back(entry);
+
+		return output;
+	}
+
+	void StringTable::setString(const WString& identifier, Language language, const WString& value)
 	{
 		LanguageData* curLanguage = &(mAllLanguages[(UINT32)language]);
 
@@ -205,7 +219,7 @@ namespace bs
 		}
 
 		mIdentifiers.insert(identifier);
-		stringData->updateString(string);
+		stringData->updateString(value);
 	}
 
 	WString StringTable::getString(const WString& identifier, Language language)

+ 28 - 7
Source/BansheeCore/Localization/BsStringTable.h

@@ -11,8 +11,11 @@ namespace bs
 	 *  @{
 	 */
 
-	/** Loosely based on ISO 639-1 two letter language codes */
-	enum class Language
+	/**
+	 * A set of all languages that localized strings can be translated to. Loosely based on ISO 639-1 two letter language
+	 * codes.
+	 */
+	enum class BS_SCRIPT_EXPORT(m:Localization) Language
 	{
 		Afar, 
 		Abkhazian, 
@@ -250,7 +253,7 @@ namespace bs
 	 */
 
 	/** Used for string localization. Stores strings and their translations in various languages. */
-	class BS_CORE_EXPORT StringTable : public Resource
+	class BS_CORE_EXPORT BS_SCRIPT_EXPORT(m:Localization) StringTable : public Resource
 	{
 		// TODO - When editing string table I will need to ensure that all languages of the same string have the same number of parameters
 
@@ -258,16 +261,33 @@ namespace bs
 		StringTable();
 		~StringTable();
 
-		/** Returns all identifiers in the table. */
-		const UnorderedSet<WString>& getIdentifiers() const { return mIdentifiers; }
+		/**
+		 * Checks does the string table contain the provided identifier.
+		 *
+		 * @param[in]	identifier		Identifier to look for.
+		 * @return						True if the identifier exists in the table, false otherwise.
+		 */
+		BS_SCRIPT_EXPORT()
+		bool contains(const WString& identifier);
+
+		/** Returns a total number of strings in the table. */
+		BS_SCRIPT_EXPORT(n:NumStrings,pr:getter)
+		UINT32 getNumStrings() const { return (UINT32)mIdentifiers.size(); }
+
+		/** Returns all identifiers that the string table contains localized strings for. */
+		BS_SCRIPT_EXPORT(n:Identifiers,pr:getter)
+		Vector<WString> getIdentifiers() const;
 
 		/**	Adds or modifies string translation for the specified language. */
-		void setString(const WString& identifier, Language language, const WString& string);
+		BS_SCRIPT_EXPORT()
+		void setString(const WString& identifier, Language language, const WString& value);
 
 		/**	Returns a string translation for the specified language. Returns the identifier itself if one doesn't exist. */
+		BS_SCRIPT_EXPORT()
 		WString getString(const WString& identifier, Language language);
 
 		/** Removes the string described by identifier, from all languages. */
+		BS_SCRIPT_EXPORT()
 		void removeString(const WString& identifier);
 
 		/**
@@ -294,6 +314,7 @@ namespace bs
 		SPtr<LocalizedStringData> getStringData(const WString& identifier, Language language, bool insertIfNonExisting = true);
 
 		/** Creates a new empty string table resource. */
+		BS_SCRIPT_EXPORT(ec:StringTable)
 		static HStringTable create();
 
 		static const Language DEFAULT_LANGUAGE;
@@ -334,7 +355,7 @@ namespace bs
 	public:
 		friend class StringTableRTTI;
 		static RTTITypeBase* getRTTIStatic();
-		virtual RTTITypeBase* getRTTI() const override;
+		RTTITypeBase* getRTTI() const override;
 	};
 
 	/** @} */

+ 1 - 1
Source/BansheeCore/Localization/BsStringTableManager.cpp

@@ -38,7 +38,7 @@ namespace bs
 		mTables.erase(id);
 	}
 
-	void StringTableManager::setTable(UINT32 id, HStringTable table)
+	void StringTableManager::setTable(UINT32 id, const HStringTable& table)
 	{
 		mTables[id] = table;
 

+ 28 - 9
Source/BansheeCore/Localization/BsStringTableManager.h

@@ -16,25 +16,44 @@ namespace bs
 	 * Manages string tables used for localizing text. Allows you to add and remove different tables and change the active 
 	 * language.
 	 */
-	class BS_CORE_EXPORT StringTableManager : public Module<StringTableManager>
+	class BS_CORE_EXPORT BS_SCRIPT_EXPORT(n:StringTables,m:Localization) StringTableManager : public Module<StringTableManager>
 	{
 	public:
 		StringTableManager();
 
-		/** Gets the currently active language. */
-		Language getActiveLanguage() const { return mActiveLanguage; }
-
-		/** Changes the currently active language. Any newly created strings will use this value. */
+		/** Determines the currently active language. Any newly created strings will use this value. */
+		BS_SCRIPT_EXPORT(n:ActiveLanguage,pr:setter)
 		void setActiveLanguage(Language language);
 
-		/** Returns the string table with the specified id. If the table doesn't exist new one is created. */
+		/** @copydoc setActiveLanguage() */
+		BS_SCRIPT_EXPORT(n:ActiveLanguage,pr:getter)
+		Language getActiveLanguage() const { return mActiveLanguage; }
+
+		/** 
+		 * Returns the string table with the specified id. If the table doesn't exist new one is created.
+		 *
+		 * @param[in]	id		Identifier of the string table.
+		 * @return				String table with the specified identifier.
+		 */
+		BS_SCRIPT_EXPORT()
 		HStringTable getTable(UINT32 id);
 
-		/** Removes the string table with the specified id. */
+		/** 
+		 * Removes the string table with the specified id.
+		 *
+		 * @param[in]	id		Identifier of the string table.
+		 */
+		BS_SCRIPT_EXPORT()
 		void removeTable(UINT32 id);
 
-		/** Registers a new string table or replaces an old one at the specified id. */
-		void setTable(UINT32 id, HStringTable table);
+		/** 
+		 * Registers a new string table or replaces an old one at the specified id.
+		 *
+		 * @param[in]	id		Identifier of the string table.
+		 * @param[in]	table	New string table to assign to the specified identifier.
+		 */
+		BS_SCRIPT_EXPORT()
+		void setTable(UINT32 id, const HStringTable& table);
 
 	private:
 		Language mActiveLanguage;

+ 11 - 16
Source/BansheeCore/RTTI/BsFontRTTI.h

@@ -18,25 +18,20 @@ namespace bs
 	class BS_CORE_EXPORT FontBitmapRTTI : public RTTIType<FontBitmap, IReflectable, FontBitmapRTTI>
 	{
 	private:
-		UINT32& getSize(FontBitmap* obj) { return obj->size; }
-		void setSize(FontBitmap* obj, UINT32& size) { obj->size = size; }
-
-		FONT_DESC& getFontDesc(FontBitmap* obj) { return obj->fontDesc; }
-		void setFontDesc(FontBitmap* obj, FONT_DESC& val) { obj->fontDesc = val; }
-
-		HTexture& getTexture(FontBitmap* obj, UINT32 idx) { return obj->texturePages.at(idx); }
-		void setTexture(FontBitmap* obj, UINT32 idx, HTexture& value) { obj->texturePages[idx] = value; }
-
-		UINT32 getTextureArraySize(FontBitmap* obj) { return (UINT32)obj->texturePages.size(); }
-		void setTextureArraySize(FontBitmap* obj, UINT32 size) { obj->texturePages.resize(size); }
+		BS_BEGIN_RTTI_MEMBERS
+			BS_RTTI_MEMBER_PLAIN(size, 0)
+			BS_RTTI_MEMBER_PLAIN(baselineOffset, 1)
+			BS_RTTI_MEMBER_PLAIN(lineHeight, 2)
+			BS_RTTI_MEMBER_PLAIN(missingGlyph, 3)
+			BS_RTTI_MEMBER_PLAIN(spaceWidth, 4)
+			BS_RTTI_MEMBER_REFL_ARRAY(texturePages, 5)
+			BS_RTTI_MEMBER_PLAIN(characters, 6)
+		BS_END_RTTI_MEMBERS
 
 	public:
 		FontBitmapRTTI()
-		{
-			addPlainField("size", 0, &FontBitmapRTTI::getSize, &FontBitmapRTTI::setSize);
-			addPlainField("fontDesc", 1, &FontBitmapRTTI::getFontDesc, &FontBitmapRTTI::setFontDesc);
-			addReflectableArrayField("texturePages", 2, &FontBitmapRTTI::getTexture, &FontBitmapRTTI::getTextureArraySize, &FontBitmapRTTI::setTexture, &FontBitmapRTTI::setTextureArraySize);
-		}
+			:mInitMembers(this)
+		{ }
 
 		const String& getRTTIName() override
 		{

+ 6 - 6
Source/BansheeCore/Text/BsFont.cpp

@@ -7,15 +7,15 @@
 
 namespace bs
 {
-	const CHAR_DESC& FontBitmap::getCharDesc(UINT32 charId) const
+	const CharDesc& FontBitmap::getCharDesc(UINT32 charId) const
 	{
-		auto iterFind = fontDesc.characters.find(charId);
-		if(iterFind != fontDesc.characters.end())
+		auto iterFind = characters.find(charId);
+		if(iterFind != characters.end())
 		{
-			return fontDesc.characters.at(charId);
+			return characters.at(charId);
 		}
 
-		return fontDesc.missingGlyph;
+		return missingGlyph;
 	}
 
 	RTTITypeBase* FontBitmap::getRTTIStatic()
@@ -43,7 +43,7 @@ namespace bs
 		Resource::initialize();
 	}
 
-	SPtr<const FontBitmap> Font::getBitmap(UINT32 size) const
+	SPtr<FontBitmap> Font::getBitmap(UINT32 size) const
 	{
 		auto iterFind = mFontDataPerSize.find(size);
 

+ 45 - 16
Source/BansheeCore/Text/BsFont.h

@@ -13,14 +13,38 @@ namespace bs
 	 */
 
 	/**	Contains textures and data about every character for a bitmap font of a specific size. */
-	struct BS_CORE_EXPORT FontBitmap : public IReflectable
+	struct BS_CORE_EXPORT BS_SCRIPT_EXPORT(m:GUI_Engine) FontBitmap : public IReflectable
 	{
 		/**	Returns a character description for the character with the specified Unicode key. */
-		const CHAR_DESC& getCharDesc(UINT32 charId) const;
+		BS_SCRIPT_EXPORT()
+		const CharDesc& getCharDesc(UINT32 charId) const;
 
-		UINT32 size; /**< Font size for which the data is contained. */
-		FONT_DESC fontDesc; /**< Font description containing per-character and general font data. */
-		Vector<HTexture> texturePages; /**< Textures in which the character's pixels are stored. */
+		/** Font size for which the data is contained. */
+		BS_SCRIPT_EXPORT()
+		UINT32 size;
+		
+		/** Y offset to the baseline on which the characters are placed, in pixels. */
+		BS_SCRIPT_EXPORT()
+		INT32 baselineOffset;
+
+		/** Height of a single line of the font, in pixels. */
+		BS_SCRIPT_EXPORT()
+		UINT32 lineHeight;
+
+		/** Character to use when data for a character is missing. */
+		BS_SCRIPT_EXPORT()
+		CharDesc missingGlyph;
+
+		/** Width of a space in pixels. */
+		BS_SCRIPT_EXPORT()
+		UINT32 spaceWidth;
+
+		/** Textures in which the character's pixels are stored. */
+		BS_SCRIPT_EXPORT()
+		Vector<HTexture> texturePages;
+
+		/** All characters in the font referenced by character ID. */
+		Map<UINT32, CharDesc> characters;
 
 		/************************************************************************/
 		/* 								SERIALIZATION                      		*/
@@ -31,26 +55,31 @@ namespace bs
 		RTTITypeBase* getRTTI() const override;
 	};
 
-	// TODO - When saved on disk font currently stores a copy of the texture pages. This should be acceptable
-	// if you import a new TrueType or OpenType font since the texture will be generated on the spot
-	// but if you use a bitmap texture to initialize the font manually, then you will potentially have duplicate textures.
-	// Also, changing the source texture will not automatically update the font because there is no direct link between them.
-	// -- This is probably not a large problem, but it is something to keep an eye out.
-
-	/**	Font resource containing data about textual characters and how to render text. */
-	class BS_CORE_EXPORT Font : public Resource
+	/**
+	 * Font resource containing data about textual characters and how to render text. Contains one or multiple font 
+	 * bitmaps, each for a specific size.
+	 */
+	class BS_CORE_EXPORT BS_SCRIPT_EXPORT(m:GUI_Engine) Font : public Resource
 	{
 	public:
 		virtual ~Font();
 
 		/**
-		 * Returns font bitmap for a specific size if it exists, null otherwise.
+		 * Returns font bitmap for a specific font size.
 		 *
 		 * @param[in]	size	Size of the bitmap in points.
+		 * @return				Bitmap object if it exists, false otherwise.
 		 */
-		SPtr<const FontBitmap> getBitmap(UINT32 size) const;
+		BS_SCRIPT_EXPORT()
+		SPtr<FontBitmap> getBitmap(UINT32 size) const;
 
-		/**	Finds the available font bitmap size closest to the provided size. */
+		/**	
+		 * Finds the available font bitmap size closest to the provided size. 
+		 * 
+		 * @param[in]	size	Size of the bitmap in points.
+		 * @return				Nearest available bitmap size.
+		 */
+		BS_SCRIPT_EXPORT()
 		INT32 getClosestSize(UINT32 size) const;
 
 		/**	Creates a new font from the provided per-size font data. */

+ 6 - 64
Source/BansheeCore/Text/BsFontDesc.h

@@ -11,14 +11,14 @@ namespace bs
 	 */
 
 	/**	Kerning pair representing larger or smaller offset between a specific pair of characters. */
-	struct KerningPair
+	struct BS_SCRIPT_EXPORT(pl:true,m:GUI_Engine) KerningPair
 	{
 		UINT32 otherCharId;
 		INT32 amount;
 	};
 
 	/**	Describes a single character in a font of a specific size. */
-	struct CHAR_DESC
+	struct BS_SCRIPT_EXPORT(pl:true,m:GUI_Engine) CharDesc
 	{
 		UINT32 charId; /**< Character ID, corresponding to a Unicode key. */
 		UINT32 page; /**< Index of the texture the character is located on. */
@@ -35,24 +35,14 @@ namespace bs
 		Vector<KerningPair> kerningPairs;
 	};
 
-	/**	Describes a font. */
-	struct FONT_DESC
-	{
-		Map<UINT32, CHAR_DESC> characters; /**< All characters in the font referenced by character ID. */
-		INT32 baselineOffset; /**< Y offset to the baseline on which the characters are placed, in pixels. */
-		UINT32 lineHeight; /**< Height of a single line of the font, in pixels. */
-		CHAR_DESC missingGlyph; /**< Character to use when data for a character is missing. */
-		UINT32 spaceWidth; /**< Width of a space in pixels. */
-	};
-
 	/** @cond SPECIALIZATIONS */
 
 	// Make CHAR_DESC serializable
-	template<> struct RTTIPlainType<CHAR_DESC>
+	template<> struct RTTIPlainType<CharDesc>
 	{	
 		enum { id = TID_CHAR_DESC }; enum { hasDynamicSize = 1 };
 
-		static void toMemory(const CHAR_DESC& data, char* memory)
+		static void toMemory(const CharDesc& data, char* memory)
 		{ 
 			UINT32 size = getDynamicSize(data);
 
@@ -74,7 +64,7 @@ namespace bs
 			memory = rttiWriteElem(data.kerningPairs, memory);
 		}
 
-		static UINT32 fromMemory(CHAR_DESC& data, char* memory)
+		static UINT32 fromMemory(CharDesc& data, char* memory)
 		{ 
 			UINT32 size;
 			memcpy(&size, memory, sizeof(UINT32)); 
@@ -97,7 +87,7 @@ namespace bs
 			return size;
 		}
 
-		static UINT32 getDynamicSize(const CHAR_DESC& data)	
+		static UINT32 getDynamicSize(const CharDesc& data)	
 		{ 
 			UINT64 dataSize = sizeof(data.charId)
 				+ sizeof(data.page)
@@ -119,54 +109,6 @@ namespace bs
 		}	
 	}; 
 
-	// Make FONT_DESC serializable
-	template<> struct RTTIPlainType<FONT_DESC>
-	{	
-		enum { id = TID_FONT_DESC }; enum { hasDynamicSize = 1 };
-
-		static void toMemory(const FONT_DESC& data, char* memory)
-		{ 
-			UINT32 size = sizeof(UINT32);
-			char* memoryStart = memory;
-			memory += sizeof(UINT32);
-			
-			memory = rttiWriteElem(data.characters, memory, size);
-			memory = rttiWriteElem(data.baselineOffset, memory, size);
-			memory = rttiWriteElem(data.lineHeight, memory, size);
-			memory = rttiWriteElem(data.missingGlyph, memory, size);
-			memory = rttiWriteElem(data.spaceWidth, memory, size);
-
-			memcpy(memoryStart, &size, sizeof(UINT32));
-		}
-
-		static UINT32 fromMemory(FONT_DESC& data, char* memory)
-		{ 
-			UINT32 size;
-			memcpy(&size, memory, sizeof(UINT32)); 
-			memory += sizeof(UINT32);
-
-			memory = rttiReadElem(data.characters, memory);
-			memory = rttiReadElem(data.baselineOffset, memory);
-			memory = rttiReadElem(data.lineHeight, memory);
-			memory = rttiReadElem(data.missingGlyph, memory);
-			memory = rttiReadElem(data.spaceWidth, memory);
-
-			return size;
-		}
-
-		static UINT32 getDynamicSize(const FONT_DESC& data)	
-		{ 
-			UINT64 dataSize = sizeof(UINT32);
-			dataSize += rttiGetElemSize(data.characters);
-			dataSize += rttiGetElemSize(data.baselineOffset);
-			dataSize += rttiGetElemSize(data.lineHeight);
-			dataSize += rttiGetElemSize(data.missingGlyph);
-			dataSize += rttiGetElemSize(data.spaceWidth);
-
-			return (UINT32)dataSize;
-		}	
-	}; 
-
 	/** @endcond */
 	/** @} */
 }

+ 20 - 20
Source/BansheeCore/Text/BsTextData.cpp

@@ -21,7 +21,7 @@ namespace bs
 	}
 
 	// Assumes charIdx is an index right after last char in the list (if any). All chars need to be sequential.
-	UINT32 TextDataBase::TextWord::addChar(UINT32 charIdx, const CHAR_DESC& desc)
+	UINT32 TextDataBase::TextWord::addChar(UINT32 charIdx, const CharDesc& desc)
 	{
 		UINT32 charWidth = calcCharWidth(mLastChar, desc);
 
@@ -38,12 +38,12 @@ namespace bs
 		return charWidth;
 	}
 
-	UINT32 TextDataBase::TextWord::calcWidthWithChar(const CHAR_DESC& desc)
+	UINT32 TextDataBase::TextWord::calcWidthWithChar(const CharDesc& desc)
 	{
 		return mWidth + calcCharWidth(mLastChar, desc);
 	}
 
-	UINT32 TextDataBase::TextWord::calcCharWidth(const CHAR_DESC* prevDesc, const CHAR_DESC& desc)
+	UINT32 TextDataBase::TextWord::calcCharWidth(const CharDesc* prevDesc, const CharDesc& desc)
 	{
 		UINT32 charWidth = desc.xAdvance;
 		if (prevDesc != nullptr)
@@ -85,7 +85,7 @@ namespace bs
 		mHasNewline = hasNewlineChar;
 	}
 
-	void TextDataBase::TextLine::add(UINT32 charIdx, const CHAR_DESC& charDesc)
+	void TextDataBase::TextLine::add(UINT32 charIdx, const CharDesc& charDesc)
 	{
 		UINT32 charWidth = 0;
 		if(mIsEmpty)
@@ -157,7 +157,7 @@ namespace bs
 		return lastWord;
 	}
 
-	UINT32 TextDataBase::TextLine::calcWidthWithChar(const CHAR_DESC& desc)
+	UINT32 TextDataBase::TextLine::calcWidthWithChar(const CharDesc& desc)
 	{
 		UINT32 charWidth = 0;
 
@@ -246,7 +246,7 @@ namespace bs
 				UINT32 kerning = 0;
 				for(UINT32 j = word.getCharsStart(); j <= word.getCharsEnd(); j++)
 				{
-					const CHAR_DESC& curChar = mTextData->getChar(j);
+					const CharDesc& curChar = mTextData->getChar(j);
 
 					INT32 curX = penX + curChar.xOffset;
 					INT32 curY = ((INT32) mTextData->getBaselineOffset() - curChar.yOffset);
@@ -262,7 +262,7 @@ namespace bs
 					kerning = 0;
 					if((j + 1) <= word.getCharsEnd())
 					{
-						const CHAR_DESC& nextChar = mTextData->getChar(j + 1);
+						const CharDesc& nextChar = mTextData->getChar(j + 1);
 						for(size_t j = 0; j < curChar.kerningPairs.size(); j++)
 						{
 							if(curChar.kerningPairs[j].otherCharId == nextChar.charId)
@@ -375,7 +375,7 @@ namespace bs
 		mFont = font;
 
 		UINT32 curLineIdx = MemBuffer->allocLine(this);
-		UINT32 curHeight = mFontData->fontDesc.lineHeight;
+		UINT32 curHeight = mFontData->lineHeight;
 		UINT32 charIdx = 0;
 
 		while(true)
@@ -384,7 +384,7 @@ namespace bs
 				break;
 
 			UINT32 charId = text[charIdx];
-			const CHAR_DESC& charDesc = mFontData->getCharDesc(charId);
+			const CharDesc& charDesc = mFontData->getCharDesc(charId);
 
 			TextLine* curLine = &MemBuffer->LineBuffer[curLineIdx];
 
@@ -395,7 +395,7 @@ namespace bs
 				curLineIdx = MemBuffer->allocLine(this);
 				curLine = &MemBuffer->LineBuffer[curLineIdx];
 
-				curHeight += mFontData->fontDesc.lineHeight;
+				curHeight += mFontData->lineHeight;
 
 				charIdx++;
 
@@ -436,7 +436,7 @@ namespace bs
 							curLineIdx = MemBuffer->allocLine(this);
 							curLine = &MemBuffer->LineBuffer[curLineIdx];
 
-							curHeight += mFontData->fontDesc.lineHeight;
+							curHeight += mFontData->lineHeight;
 
 							curLine->addWord(lastWordIdx, lastWord);
 						}
@@ -450,7 +450,7 @@ namespace bs
 								curLineIdx = MemBuffer->allocLine(this);
 								curLine = &MemBuffer->LineBuffer[curLineIdx];
 
-								curHeight += mFontData->fontDesc.lineHeight;
+								curHeight += mFontData->lineHeight;
 							}
 							else
 							{
@@ -461,7 +461,7 @@ namespace bs
 									curLineIdx = MemBuffer->allocLine(this);
 									curLine = &MemBuffer->LineBuffer[curLineIdx];
 
-									curHeight += mFontData->fontDesc.lineHeight;
+									curHeight += mFontData->lineHeight;
 								}
 
 								curLine->addWord(lastWordIdx, lastWord);
@@ -475,7 +475,7 @@ namespace bs
 						curLineIdx = MemBuffer->allocLine(this);
 						curLine = &MemBuffer->LineBuffer[curLineIdx];
 
-						curHeight += mFontData->fontDesc.lineHeight;
+						curHeight += mFontData->lineHeight;
 					}
 				}
 			}
@@ -510,7 +510,7 @@ namespace bs
 
 	void TextDataBase::generatePersistentData(const WString& text, UINT8* buffer, UINT32& size, bool freeTemporary)
 	{
-		UINT32 charArraySize = mNumChars * sizeof(const CHAR_DESC*);
+		UINT32 charArraySize = mNumChars * sizeof(const CharDesc*);
 		UINT32 wordArraySize = mNumWords * sizeof(TextWord);
 		UINT32 lineArraySize = mNumLines * sizeof(TextLine);
 		UINT32 pageInfoArraySize = mNumPageInfos * sizeof(PageInfo);
@@ -522,12 +522,12 @@ namespace bs
 		}
 
 		UINT8* dataPtr = (UINT8*)buffer;
-		mChars = (const CHAR_DESC**)dataPtr;
+		mChars = (const CharDesc**)dataPtr;
 
 		for (UINT32 i = 0; i < mNumChars; i++)
 		{
 			UINT32 charId = text[i];
-			const CHAR_DESC& charDesc = mFontData->getCharDesc(charId);
+			const CharDesc& charDesc = mFontData->getCharDesc(charId);
 
 			mChars[i] = &charDesc;
 		}
@@ -555,17 +555,17 @@ namespace bs
 
 	INT32 TextDataBase::getBaselineOffset() const 
 	{ 
-		return mFontData->fontDesc.baselineOffset; 
+		return mFontData->baselineOffset; 
 	}
 
 	UINT32 TextDataBase::getLineHeight() const 
 	{ 
-		return mFontData->fontDesc.lineHeight; 
+		return mFontData->lineHeight; 
 	}
 
 	UINT32 TextDataBase::getSpaceWidth() const 
 	{ 
-		return mFontData->fontDesc.spaceWidth; 
+		return mFontData->spaceWidth; 
 	}
 
 	void TextDataBase::initAlloc()

+ 8 - 8
Source/BansheeCore/Text/BsTextData.h

@@ -39,7 +39,7 @@ namespace bs
 			 * @param[in]	desc		Character description from the font.
 			 * @return					How many pixels did the added character expand the word by.
 			 */
-			UINT32 addChar(UINT32 charIdx, const CHAR_DESC& desc);
+			UINT32 addChar(UINT32 charIdx, const CharDesc& desc);
 
 			/** Adds a space to the word. Word must have previously have been declared as a "spacer". */
 			void addSpace(UINT32 spaceWidth);
@@ -56,7 +56,7 @@ namespace bs
 			 * @param[in]	desc	Character description from the font.
 			 * @return				Width of the word in pixels with the character appended to it.
 			 */
-			UINT32 calcWidthWithChar(const CHAR_DESC& desc);
+			UINT32 calcWidthWithChar(const CharDesc& desc);
 
 			/**
 			 * Returns true if word is a spacer. Spacers contain just a space of a certain length with no actual characters.
@@ -79,14 +79,14 @@ namespace bs
 			 * @param[in]	desc		Character description from the font.
 			 * @return 					How many pixels would the added character expand the word by.
 			 */
-			static UINT32 calcCharWidth(const CHAR_DESC* prevDesc, const CHAR_DESC& desc);
+			static UINT32 calcCharWidth(const CharDesc* prevDesc, const CharDesc& desc);
 
 		private:
 			UINT32 mCharsStart, mCharsEnd;
 			UINT32 mWidth;
 			UINT32 mHeight;
 
-			const CHAR_DESC* mLastChar;
+			const CharDesc* mLastChar;
 
 			bool mSpacer;
 			UINT32 mSpaceWidth;
@@ -127,7 +127,7 @@ namespace bs
 			 * @param[in]	desc	Character description from the font.
 			 * @return				Width of the line in pixels with the character appended to it.
 			 */
-			UINT32 calcWidthWithChar(const CHAR_DESC& desc);
+			UINT32 calcWidthWithChar(const CharDesc& desc);
 
 			/**
 			 * Fills the vertex/uv/index buffers for the specified page, with all the character data needed for rendering.
@@ -163,7 +163,7 @@ namespace bs
 			 * @param[in]	charIdx		Sequential index of the character in the original string.
 			 * @param[in]	desc		Character description from the font.
 			 */
-			void add(UINT32 charIdx, const CHAR_DESC& charDesc);
+			void add(UINT32 charIdx, const CharDesc& charDesc);
 
 			/**	Appends a space to the line. */
 			void addSpace(UINT32 spaceWidth);
@@ -269,13 +269,13 @@ namespace bs
 		UINT32 getSpaceWidth() const;
 
 		/** Gets a description of a single character referenced by its sequential index based on the original string. */
-		const CHAR_DESC& getChar(UINT32 idx) const { return *mChars[idx]; }
+		const CharDesc& getChar(UINT32 idx) const { return *mChars[idx]; }
 
 		/** Gets a description of a single word referenced by its sequential index based on the original string. */
 		const TextWord& getWord(UINT32 idx) const { return mWords[idx]; }
 
 	protected:
-		const CHAR_DESC** mChars;
+		const CharDesc** mChars;
 		UINT32 mNumChars;
 
 		TextWord* mWords;

+ 23 - 26
Source/BansheeEngine/2D/BsSpriteTexture.h

@@ -16,43 +16,36 @@ namespace bs
 	 * Texture interface that encapsulates underlying texture which allows us to create a sprite texture atlas (for example 
 	 * multiple SpriteTexture%s referencing different parts of a single Texture).
 	 */
-	class BS_EXPORT SpriteTexture : public Resource
+	class BS_EXPORT BS_SCRIPT_EXPORT(m:Rendering) SpriteTexture : public Resource
 	{
 	public:
-		/**	Gets the internal texture that the sprite texture references. */
-		const HTexture& getTexture() const;
-
-		/**	Sets the internal texture that the sprite texture references. */
+		/**	Determines the internal texture that the sprite texture references. */
+		BS_SCRIPT_EXPORT(n:Texture,pr:setter)
 		void setTexture(const HTexture& texture);
 
-		/**
-		 * Gets the offset into the referenced texture where the sprite starts.
-		 *
-		 * @return	Offset in UV coordinates, range [0, 1].
-		 */
-		Vector2 getOffset() const { return mUVOffset; }
+		/**	@copydoc setTexture() */
+		BS_SCRIPT_EXPORT(n:Texture,pr:getter)
+		const HTexture& getTexture() const;
 
 		/**
-		 * Sets the offset into the referenced texture where the sprite starts.
-		 *
-		 * @param	offset	Offset in UV coordinates, range [0, 1].
+		 * Determines the offset into the referenced texture where the sprite starts. The offset is in UV coordinates,
+		 * in range [0, 1].
 		 */
+		BS_SCRIPT_EXPORT(n:Offset,pr:setter)
 		void setOffset(const Vector2& offset) { mUVOffset = offset; }
 
-		/**
-		 * Gets the size of the sprite in the referenced texture.
-		 *
-		 * @return	Size in UV coordinates, range [0, 1].
-		 */
-		Vector2 getScale() const { return mUVScale; }
+		/** @copydoc setOffset() */
+		BS_SCRIPT_EXPORT(n:Offset,pr:getter)
+		Vector2 getOffset() const { return mUVOffset; }
 
-		/**
-		 * Sets the size of the sprite in the referenced texture.
-		 *
-		 * @param	scale	Size in UV coordinates, range [0, 1].
-		 */
+		/** Determines the size of the sprite in the referenced texture. Size is in UV coordinates, range [0, 1]. */
+		BS_SCRIPT_EXPORT(n:Scale,pr:setter)
 		void setScale(const Vector2& scale) { mUVScale = scale; }
 
+		/** @copydoc setScale() */
+		BS_SCRIPT_EXPORT(n:Scale,pr:getter)
+		Vector2 getScale() const { return mUVScale; }
+
 		/** Transforms wanted UV coordinates into coordinates you can use for sampling the internal texture. */
 		Vector2 transformUV(const Vector2& uv) const;
 
@@ -60,15 +53,19 @@ namespace bs
 		static const HSpriteTexture& dummy();
 
 		/**	Returns width of the sprite texture in pixels. */
+		BS_SCRIPT_EXPORT(n:Width,pr:getter)
 		UINT32 getWidth() const;
 
 		/**	Returns height of the sprite texture in pixels. */
+		BS_SCRIPT_EXPORT(n:Height,pr:getter)
 		UINT32 getHeight() const;
 
 		/**	Creates a new sprite texture that references the entire area of the provided texture. */
+		BS_SCRIPT_EXPORT(ec:SpriteTexture)
 		static HSpriteTexture create(const HTexture& texture);
 
 		/**	Creates a new sprite texture that references a sub-area of the provided	texture. */
+		BS_SCRIPT_EXPORT(ec:SpriteTexture)
 		static HSpriteTexture create(const Vector2& uvOffset, const Vector2& uvScale, const HTexture& texture);
 
 		/**	Checks if the sprite texture and its internal texture have been loaded. */
@@ -110,7 +107,7 @@ namespace bs
 	public:
 		friend class SpriteTextureRTTI;
 		static RTTITypeBase* getRTTIStatic();
-		virtual RTTITypeBase* getRTTI() const override;
+		RTTITypeBase* getRTTI() const override;
 	};
 
 	/** @} */

+ 1 - 1
Source/BansheeEngine/GUI/BsGUIInputCaret.cpp

@@ -286,7 +286,7 @@ namespace bs
 				SPtr<const FontBitmap> fontData = mTextDesc.font->getBitmap(nearestSize);
 
 				if(fontData != nullptr)
-					return fontData->fontDesc.lineHeight;
+					return fontData->lineHeight;
 			}
 		}
 

+ 1 - 1
Source/BansheeFontImporter/BsFontImporter.cpp

@@ -265,7 +265,7 @@ namespace bs
 						BS_EXCEPT(InternalErrorException, "Unsupported pixel mode for a FreeType bitmap.");
 
 					// Store character information
-					CHAR_DESC charDesc;
+					CharDesc charDesc;
 
 					float invTexWidth = 1.0f / pageIter->width;
 					float invTexHeight = 1.0f / pageIter->height;

+ 1 - 1
Source/CMakeLists.txt

@@ -5,7 +5,7 @@ project (Banshee)
 set (BS_VERSION_MAJOR 0)
 set (BS_VERSION_MINOR 4)
 
-set (BS_PREBUILT_DEPENDENCIES_VERSION 12)
+set (BS_PREBUILT_DEPENDENCIES_VERSION 13)
 set (BS_SRC_DEPENDENCIES_VERSION 15)
 set (BS_BUILTIN_ASSETS_VERSION 1)
 

+ 5 - 5
Source/MBansheeEditor/Inspectors/StringTableInspector.cs

@@ -56,7 +56,7 @@ namespace BansheeEditor
 
             string[] identifiers = stringTable.Identifiers;
             foreach (var identifier in identifiers)
-                strings[identifier] = stringTable.GetString(identifier);
+                strings[identifier] = stringTable.GetString(identifier, StringTables.ActiveLanguage);
 
             languageField = new GUIEnumField(typeof (Language));
             languageField.OnSelectionChanged += x =>
@@ -81,12 +81,12 @@ namespace BansheeEditor
                     {
                         if (stringTable.Contains(KVP.Key))
                         {
-                            string oldValue = stringTable.GetString(KVP.Key);
+                            string oldValue = stringTable.GetString(KVP.Key, StringTables.ActiveLanguage);
                             if (oldValue != KVP.Value)
-                                stringTable.SetString(KVP.Key, KVP.Value);
+                                stringTable.SetString(KVP.Key, StringTables.ActiveLanguage, KVP.Value);
                         }
                         else
-                            stringTable.SetString(KVP.Key, KVP.Value);
+                            stringTable.SetString(KVP.Key, StringTables.ActiveLanguage, KVP.Value);
                     }
 
                     string[] oldIdentifiers = stringTable.Identifiers;
@@ -111,7 +111,7 @@ namespace BansheeEditor
 
             valuesField.OnValueChanged += x =>
             {
-                stringTable.SetString(x, strings[x]);
+                stringTable.SetString(x, StringTables.ActiveLanguage, strings[x]);
                 EditorApplication.SetDirty(stringTable);
             };
 

+ 18 - 7
Source/MBansheeEditor/Windows/Library/ImportOptions.cs

@@ -2,6 +2,7 @@
 //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
 using System;
 using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
 using BansheeEngine;
 
 namespace BansheeEditor
@@ -28,11 +29,11 @@ namespace BansheeEditor
         /// </summary>
         Single,
 
-		/// <summary>
+        /// <summary>
         /// Source is a list of 6 images, either sequentially next to each other or in a cross format. The system will 
         /// automatically guess the layout and orientation based on the aspect ratio.
         /// </summary>
-		Faces,
+        Faces,
 
         /// <summary>
         /// Source is a single spherical panoramic image.
@@ -422,6 +423,16 @@ namespace BansheeEditor
         Convex
     }
 
+    /// <summary>
+    /// Marks a range of characters in a font.
+    /// </summary>
+    [StructLayout(LayoutKind.Sequential), SerializeObject]
+    public struct CharRange
+    {
+        public int start;
+        public int end;
+    }
+
     /// <summary>
     /// Import options that provide various options for controlling how is a font resource imported.
     /// </summary>
@@ -565,16 +576,16 @@ namespace BansheeEditor
     /// <summary>
     /// Determines how is a font rendered into the bitmap texture.
     /// </summary>
-	public enum FontRenderMode // Note: Must match C++ enum FontRenderMode
+    public enum FontRenderMode // Note: Must match C++ enum FontRenderMode
     {
         /// <summary>Render antialiased fonts without hinting (slightly more blurry).</summary>
-		Smooth,
+        Smooth,
         /// <summary>Render non-antialiased fonts without hinting (slightly more blurry).</summary>
-		Raster,
+        Raster,
         /// <summary>Render antialiased fonts with hinting.</summary>
-		HintedSmooth,
+        HintedSmooth,
         /// <summary>Render non-antialiased fonts with hinting.</summary>
-		HintedRaster
+        HintedRaster
     }
 
     /// <summary>

+ 1 - 1
Source/MBansheeEngine/GUI/ContextMenu.cs

@@ -6,7 +6,7 @@ using System.Runtime.CompilerServices;
 
 namespace BansheeEngine
 {
-    /** @addtogroup GUI-Engine
+    /** @addtogroup GUI_Engine
      *  @{
      */
 

+ 0 - 206
Source/MBansheeEngine/GUI/Font.cs

@@ -1,206 +0,0 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-using System;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-namespace BansheeEngine
-{
-    /** @addtogroup GUI-Engine
-     *  @{
-     */
-
-    /// <summary>
-    /// Font resource containing data about textual characters and how to render text. Contains one or multiple font 
-    /// bitmaps, each for a specific size.
-    /// </summary>
-    public sealed class Font : Resource
-    {
-        /// <summary>
-        /// Creates a new font resource. For runtime use only.
-        /// </summary>
-        private Font()
-        { }
-
-        /// <summary>
-        /// Returns font bitmap for a specific font size.
-        /// </summary>
-        /// <param name="size">Size of the bitmap in points.</param>
-        /// <returns>Bitmap object if size was found, null otherwise.</returns>
-        public FontBitmap GetBitmap(int size)
-        {
-            return Internal_GetBitmap(mCachedPtr, size);
-        }
-
-        /// <summary>
-        /// Finds the available font bitmap size closest to the provided size.
-        /// </summary>
-        /// <param name="size">Size of the bitmap in points.</param>
-        /// <returns>Nearest available bitmap size.</returns>
-        public int GetClosestSize(int size)
-        {
-            return Internal_GetClosestSize(mCachedPtr, size);
-        }
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern FontBitmap Internal_GetBitmap(IntPtr instance, int size);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern int Internal_GetClosestSize(IntPtr instance, int size);
-    }
-
-    /// <summary>
-    /// Contains textures and data about every character for a bitmap font of a specific size.
-    /// </summary>
-    public sealed class FontBitmap : ScriptObject
-    {
-        /// <summary>
-        /// Constructor for internal runtime use only.
-        /// </summary>
-        internal FontBitmap()
-        { }
-
-        /// <summary>
-        /// Size of the font in the bitmap, in points.
-        /// </summary>
-        public int Size { get { return Internal_GetSize(mCachedPtr); } }
-
-        /// <summary>
-        /// Y offset to the baseline on which the characters are placed, in pixels.
-        /// </summary>
-        public int BaselineOffset { get { return Internal_GetBaselineOffset(mCachedPtr); } }
-
-        /// <summary>
-        /// Height of a single line of the font, in pixels.
-        /// </summary>
-        public int LineHeight { get { return Internal_GetLineHeight(mCachedPtr); } }
-
-        /// <summary>
-        /// Width of a space in pixels.
-        /// </summary>
-        public int SpaceWidth { get { return Internal_GetSpaceWidth(mCachedPtr); } }
-
-        /// <summary>
-        /// Character to use when data for a character is missing.
-        /// </summary>
-        public CharDesc MissingChar { get { CharDesc value; Internal_GetMissingChar(mCachedPtr, out value); return value; } }
-
-        /// <summary>
-        /// Textures in which the character's pixels are stored.
-        /// </summary>
-        public Texture[] Pages { get { return Internal_GetPages(mCachedPtr); } }
-
-        /// <summary>
-        /// Returns a description of the character in the bitmap.
-        /// </summary>
-        /// <param name="id">Unicode key of the character to retrieve.</param>
-        /// <returns>Character data if it was found in the bitmap, missing character data otherwise.</returns>
-        public CharDesc GetChar(int id)
-        {
-            CharDesc value;
-            Internal_GetChar(mCachedPtr, id, out value);
-            return value;
-        }
-
-        /// <summary>
-        /// Returns a set of pairs that determine if the provided character should be closer or father together than normal
-        /// with a specific other character. For example the combination of "A" and "V" characters is normally a kerning
-        /// pair "AV" as their bounds overlap and are closer together than characters would be normally.
-        /// </summary>
-        /// <param name="id">Unicode key of the character to retrieve kerning pairs for.</param>
-        /// <returns>A set of kerning pairs for the character.</returns>
-        public KerningPair[] GetKerning(int id)
-        {
-            return Internal_GetKerning(mCachedPtr, id);
-        }
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern int Internal_GetSize(IntPtr instance);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern int Internal_GetBaselineOffset(IntPtr instance);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern int Internal_GetLineHeight(IntPtr instance);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern int Internal_GetSpaceWidth(IntPtr instance);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_GetMissingChar(IntPtr instance, out CharDesc output);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern Texture[] Internal_GetPages(IntPtr instance);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_GetChar(IntPtr instance, int id, out CharDesc output);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern KerningPair[] Internal_GetKerning(IntPtr instance, int id);
-    }
-
-    /// <summary>
-    /// Marks a range of characters in a font.
-    /// </summary>
-    [StructLayout(LayoutKind.Sequential), SerializeObject]
-    public struct CharRange
-    {
-        public int start;
-        public int end;
-    }
-
-    /// <summary>
-    /// Kerning pair representing larger or smaller offset between a specific pair of characters.
-    /// </summary>
-    [StructLayout(LayoutKind.Sequential), SerializeObject]
-    public struct KerningPair // Note: Must match C++ struct KerningPair
-    {
-        public int OtherChar;
-        public int Amount;
-    }
-
-    /// <summary>
-    /// Describes a single character in a font of a specific size.
-    /// </summary>
-    [StructLayout(LayoutKind.Sequential), SerializeObject]
-    public struct CharDesc // Note: Must match C++ struct ScriptCharDesc
-    {
-        /// <summary>Character ID, corresponding to a Unicode key.</summary>
-        public int Id;
-
-        /// <summary>Index of the texture the character is located on.</summary>
-        public int Page; 
-
-        /// <summary>Texture coordinates of the character in the page texture.</summary>
-        public float UVX;
-
-        /// <summary>Texture coordinates of the character in the page texture.</summary>
-        public float UVY;
-
-        /// <summary>Size of the character in texture coordinates.</summary>
-        public float UVWidth;
-
-        /// <summary>Size of the character in texture coordinates.</summary>
-        public float UVHeight;
-
-        /// <summary>Size of the character in pixels.</summary>
-        public int Width;
-
-        /// <summary>Size of the character in pixels.</summary>
-        public int Height;
-
-        /// <summary>Offset for the visible portion of the character in pixels.</summary>
-        public int XOffset;
-
-        /// <summary>Offset for the visible portion of the character in pixels.</summary>
-        public int YOffset;
-
-        /// <summary>Determines how much to advance the pen after writing this character, in pixels.</summary>
-        public int XAdvance;
-
-        /// <summary>Determines how much to advance the pen after writing this character, in pixels.</summary>
-        public int YAdvance;
-    }
-
-    /** @} */
-}

+ 1 - 1
Source/MBansheeEngine/GUI/GUI.cs

@@ -5,7 +5,7 @@ using System.Runtime.CompilerServices;
 
 namespace BansheeEngine
 {
-    /** @addtogroup GUI-Engine
+    /** @addtogroup GUI_Engine
      *  @{
      */
 

+ 1 - 1
Source/MBansheeEngine/GUI/GUIButton.cs

@@ -5,7 +5,7 @@ using System.Runtime.CompilerServices;
 
 namespace BansheeEngine
 {
-    /** @addtogroup GUI-Engine
+    /** @addtogroup GUI_Engine
      *  @{
      */
 

+ 1 - 1
Source/MBansheeEngine/GUI/GUICanvas.cs

@@ -5,7 +5,7 @@ using System.Runtime.CompilerServices;
 
 namespace BansheeEngine
 {
-    /** @addtogroup GUI-Engine
+    /** @addtogroup GUI_Engine
      *  @{
      */
 

+ 28 - 28
Source/MBansheeEngine/GUI/GUIContent.cs

@@ -4,32 +4,32 @@ using System.Runtime.CompilerServices;
 
 namespace BansheeEngine
 {
-    /** @addtogroup GUI-Engine
+    /** @addtogroup GUI_Engine
      *  @{
      */
 
     /// <summary>
     /// Type of GUI element states.
     /// </summary>
-	public enum GUIElementState
-	{
+    public enum GUIElementState
+    {
         /// <summary>Normal state when button is not being iteracted with.</summary>
-		Normal = 0x01,
+        Normal = 0x01,
         /// <summary>State when pointer is hovering over the button.</summary>
-		Hover = 0x02,
+        Hover = 0x02,
         /// <summary>State when button is being clicked.</summary>
-		Active = 0x04,
+        Active = 0x04,
         /// <summary>State when button has been selected.</summary>
-		Focused = 0x08,
+        Focused = 0x08,
         /// <summary>Normal state when button is not being iteracted with and is in "on" state.</summary>
-		NormalOn = 0x11,
+        NormalOn = 0x11,
         /// <summary>State when pointer is hovering over the button and is in "on" state.</summary>
-		HoverOn = 0x12,
+        HoverOn = 0x12,
         /// <summary>State when button is being clicked and is in "on" state.</summary>
-		ActiveOn = 0x14,
+        ActiveOn = 0x14,
         /// <summary>State when button has been selected and is in "on" state.</summary>
-		FocusedOn = 0x18
-	};
+        FocusedOn = 0x18
+    };
 
     /// <summary>
     /// Holds data used for displaying content in a GUIElement. Content can consist of a string, image, a tooltip or none 
@@ -55,26 +55,26 @@ namespace BansheeEngine
         public SpriteTexture GetImage(GUIElementState state = GUIElementState.Normal)
         {
             switch (state)
-		    {
-		    case GUIElementState.Normal:
-			    return images.normal;
-		    case GUIElementState.Hover:
+            {
+            case GUIElementState.Normal:
+                return images.normal;
+            case GUIElementState.Hover:
                 return images.hover;
-		    case GUIElementState.Active:
+            case GUIElementState.Active:
                 return images.active;
-		    case GUIElementState.Focused:
+            case GUIElementState.Focused:
                 return images.focused;
-		    case GUIElementState.NormalOn:
+            case GUIElementState.NormalOn:
                 return images.normalOn;
-		    case GUIElementState.HoverOn:
+            case GUIElementState.HoverOn:
                 return images.hoverOn;
-		    case GUIElementState.ActiveOn:
+            case GUIElementState.ActiveOn:
                 return images.activeOn;
-		    case GUIElementState.FocusedOn:
+            case GUIElementState.FocusedOn:
                 return images.focusedOn;
-		    default:
+            default:
                 return images.normal;
-		    }
+            }
         }
 
         /// <summary>
@@ -89,10 +89,10 @@ namespace BansheeEngine
         /// Constructs content with just a string.
         /// </summary>
         /// <param name="text">Textual portion of the content to be displayed as label in GUI elements.</param>
-		public GUIContent(LocString text)
-		{
-		    this.text = text;
-		}
+        public GUIContent(LocString text)
+        {
+            this.text = text;
+        }
 
         /// <summary>
         /// Constructs content with a string and a tooltip.

+ 1 - 1
Source/MBansheeEngine/GUI/GUIElement.cs

@@ -6,7 +6,7 @@ using System.Runtime.CompilerServices;
 
 namespace BansheeEngine
 {
-    /** @addtogroup GUI-Engine
+    /** @addtogroup GUI_Engine
      *  @{
      */
 

+ 1 - 1
Source/MBansheeEngine/GUI/GUIElementStateStyle.cs

@@ -5,7 +5,7 @@ using System.Runtime.CompilerServices;
 
 namespace BansheeEngine
 {
-    /** @addtogroup GUI-Engine
+    /** @addtogroup GUI_Engine
      *  @{
      */
 

+ 15 - 15
Source/MBansheeEngine/GUI/GUIElementStyle.cs

@@ -6,7 +6,7 @@ using System.Runtime.InteropServices;
 
 namespace BansheeEngine
 {
-    /** @addtogroup GUI-Engine
+    /** @addtogroup GUI_Engine
      *  @{
      */
 
@@ -15,33 +15,33 @@ namespace BansheeEngine
     /// </summary>
     [StructLayout(LayoutKind.Sequential)]
     public struct RectOffset // Note: Must match the C++ struct RectOffset
-	{
-		public int left, right, top, bottom;
-	};
+    {
+        public int left, right, top, bottom;
+    };
 
     /// <summary>
     /// Possible positions used for positioning content image within a GUI element.
     /// </summary>
     public enum GUIImagePosition // Note: Must match the C++ enum GUIImagePosition.
-	{
-		Left, Right
-	};
+    {
+        Left, Right
+    };
 
     /// <summary>
     /// Specifies how is text horizontally aligned within its bounds.
     /// </summary>
     public enum TextHorzAlign // Note: Must match the C++ enum TextHorzAlign.
-	{
-		Left, Center, Right
-	};
+    {
+        Left, Center, Right
+    };
 
     /// <summary>
     /// Specifies how is text vertically aligned within its bounds.
     /// </summary>
     public enum TextVertAlign // Note: Must match the C++ enum TextVertAlign
-	{
-		Top, Center, Bottom
-	};
+    {
+        Top, Center, Bottom
+    };
 
     /// <summary>
     /// GUI element style that determines the look of a GUI element, as well as the element's default layout options. 
@@ -57,9 +57,9 @@ namespace BansheeEngine
         /// <summary>
         /// Constructs a new GUI element style with default values.
         /// </summary>
-		public GUIElementStyle()
+        public GUIElementStyle()
         {
-		    Internal_CreateInstance(this);
+            Internal_CreateInstance(this);
         }
 
         /// <summary>

+ 1 - 1
Source/MBansheeEngine/GUI/GUILabel.cs

@@ -5,7 +5,7 @@ using System.Runtime.CompilerServices;
 
 namespace BansheeEngine
 {
-    /** @addtogroup GUI-Engine
+    /** @addtogroup GUI_Engine
      *  @{
      */
 

+ 1 - 1
Source/MBansheeEngine/GUI/GUILayout.cs

@@ -6,7 +6,7 @@ using System.Runtime.CompilerServices;
 
 namespace BansheeEngine
 {
-    /** @addtogroup GUI-Engine
+    /** @addtogroup GUI_Engine
      *  @{
      */
 

+ 1 - 1
Source/MBansheeEngine/GUI/GUILayoutX.cs

@@ -5,7 +5,7 @@ using System.Runtime.CompilerServices;
 
 namespace BansheeEngine
 {
-    /** @addtogroup GUI-Engine
+    /** @addtogroup GUI_Engine
      *  @{
      */
 

+ 1 - 1
Source/MBansheeEngine/GUI/GUILayoutY.cs

@@ -5,7 +5,7 @@ using System.Runtime.CompilerServices;
 
 namespace BansheeEngine
 {
-    /** @addtogroup GUI-Engine
+    /** @addtogroup GUI_Engine
      *  @{
      */
 

+ 1 - 1
Source/MBansheeEngine/GUI/GUIListBox.cs

@@ -5,7 +5,7 @@ using System.Runtime.CompilerServices;
 
 namespace BansheeEngine
 {
-    /** @addtogroup GUI-Engine
+    /** @addtogroup GUI_Engine
      *  @{
      */
 

+ 1 - 1
Source/MBansheeEngine/GUI/GUIListView.cs

@@ -4,7 +4,7 @@ using System.Collections.Generic;
 
 namespace BansheeEngine
 {
-    /** @addtogroup GUI-Engine
+    /** @addtogroup GUI_Engine
      *  @{
      */
 

+ 1 - 1
Source/MBansheeEngine/GUI/GUIOption.cs

@@ -5,7 +5,7 @@ using System.Runtime.InteropServices;
 
 namespace BansheeEngine
 {
-    /** @addtogroup GUI-Engine
+    /** @addtogroup GUI_Engine
      *  @{
      */
 

+ 1 - 1
Source/MBansheeEngine/GUI/GUIPanel.cs

@@ -5,7 +5,7 @@ using System.Runtime.CompilerServices;
 
 namespace BansheeEngine
 {
-    /** @addtogroup GUI-Engine
+    /** @addtogroup GUI_Engine
      *  @{
      */
 

+ 1 - 1
Source/MBansheeEngine/GUI/GUIProgressBar.cs

@@ -5,7 +5,7 @@ using System.Runtime.CompilerServices;
 
 namespace BansheeEngine
 {
-    /** @addtogroup GUI-Engine
+    /** @addtogroup GUI_Engine
      *  @{
      */
 

+ 1 - 1
Source/MBansheeEngine/GUI/GUIRenderTexture.cs

@@ -5,7 +5,7 @@ using System.Runtime.CompilerServices;
 
 namespace BansheeEngine
 {
-    /** @addtogroup GUI-Engine
+    /** @addtogroup GUI_Engine
      *  @{
      */
 

+ 6 - 6
Source/MBansheeEngine/GUI/GUIScrollArea.cs

@@ -5,7 +5,7 @@ using System.Runtime.CompilerServices;
 
 namespace BansheeEngine
 {
-    /** @addtogroup GUI-Engine
+    /** @addtogroup GUI_Engine
      *  @{
      */
 
@@ -13,11 +13,11 @@ namespace BansheeEngine
     /// Scroll bar options for a GUI scroll area.
     /// </summary>
     public enum ScrollBarType // Note: Must match the C++ enum ScrollBarType
-	{
-		ShowIfDoesntFit,
-		AlwaysShow,
-		NeverShow
-	};
+    {
+        ShowIfDoesntFit,
+        AlwaysShow,
+        NeverShow
+    };
 
     /// <summary>
     /// A GUI element container with support for vertical & horizontal scrolling.

+ 1 - 1
Source/MBansheeEngine/GUI/GUIScrollBar.cs

@@ -5,7 +5,7 @@ using System.Runtime.CompilerServices;
 
 namespace BansheeEngine
 {
-    /** @addtogroup GUI-Engine
+    /** @addtogroup GUI_Engine
      *  @{
      */
 

+ 1 - 1
Source/MBansheeEngine/GUI/GUISkin.cs

@@ -5,7 +5,7 @@ using System.Runtime.CompilerServices;
 
 namespace BansheeEngine
 {
-    /** @addtogroup GUI-Engine
+    /** @addtogroup GUI_Engine
      *  @{
      */
 

+ 1 - 1
Source/MBansheeEngine/GUI/GUISlider.cs

@@ -5,7 +5,7 @@ using System.Runtime.CompilerServices;
 
 namespace BansheeEngine
 {
-    /** @addtogroup GUI-Engine
+    /** @addtogroup GUI_Engine
      *  @{
      */
 

+ 1 - 1
Source/MBansheeEngine/GUI/GUISpace.cs

@@ -5,7 +5,7 @@ using System.Runtime.CompilerServices;
 
 namespace BansheeEngine
 {
-    /** @addtogroup GUI-Engine
+    /** @addtogroup GUI_Engine
      *  @{
      */
 

+ 1 - 1
Source/MBansheeEngine/GUI/GUITextBox.cs

@@ -5,7 +5,7 @@ using System.Runtime.CompilerServices;
 
 namespace BansheeEngine
 {
-    /** @addtogroup GUI-Engine
+    /** @addtogroup GUI_Engine
      *  @{
      */
 

+ 7 - 7
Source/MBansheeEngine/GUI/GUITexture.cs

@@ -5,7 +5,7 @@ using System.Runtime.CompilerServices;
 
 namespace BansheeEngine
 {
-    /** @addtogroup GUI-Engine
+    /** @addtogroup GUI_Engine
      *  @{
      */
 
@@ -13,24 +13,24 @@ namespace BansheeEngine
     /// Type of scaling modes for GUI images.
     /// </summary>
     public enum GUITextureScaleMode // Note: Must match C++ enum TextureScaleMode
-	{
+    {
         /// <summary>
         /// Image will stretch non-uniformly in all dimensions in order to cover the assigned area fully.
         /// </summary>
-		StretchToFit,
+        StretchToFit,
         /// <summary>
         /// Image will scale uniformly until one dimension is aligned with the assigned area. Remaining dimension might have empty space.
         /// </summary>
-		ScaleToFit,
+        ScaleToFit,
         /// <summary>
         /// Image will scale uniformly until both dimensions are larger or aligned with the assigned area. Remaining dimension might be cropped.
         /// </summary>
-		CropToFit,
+        CropToFit,
         /// <summary>
         /// Image will keep its original size, but will repeat in order to fill the assigned area.
         /// </summary>
-		RepeatToFit
-	};
+        RepeatToFit
+    };
 
     /// <summary>
     /// A GUI element that displays a texture.

+ 1 - 1
Source/MBansheeEngine/GUI/GUIToggle.cs

@@ -5,7 +5,7 @@ using System.Runtime.CompilerServices;
 
 namespace BansheeEngine
 {
-    /** @addtogroup GUI-Engine
+    /** @addtogroup GUI_Engine
      *  @{
      */
 

+ 1 - 1
Source/MBansheeEngine/GUI/GUIToggleGroup.cs

@@ -5,7 +5,7 @@ using System.Runtime.CompilerServices;
 
 namespace BansheeEngine
 {
-    /** @addtogroup GUI-Engine
+    /** @addtogroup GUI_Engine
      *  @{
      */
 

+ 1 - 1
Source/MBansheeEngine/GUI/GUIUtility.cs

@@ -5,7 +5,7 @@ using System.Runtime.CompilerServices;
 
 namespace BansheeEngine
 {
-    /** @addtogroup GUI-Engine
+    /** @addtogroup GUI_Engine
      *  @{
      */
 

+ 1 - 1
Source/MBansheeEngine/GUI/GUIWidget.cs

@@ -2,7 +2,7 @@
 //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
 namespace BansheeEngine
 {
-    /** @addtogroup GUI-Engine
+    /** @addtogroup GUI_Engine
      *  @{
      */
 

+ 1 - 1
Source/MBansheeEngine/GUI/LocString.cs

@@ -5,7 +5,7 @@ using System.Runtime.CompilerServices;
 
 namespace BansheeEngine
 {
-    /** @addtogroup GUI-Engine
+    /** @addtogroup GUI_Engine
      *  @{
      */
 

+ 1 - 1
Source/MBansheeEngine/GUI/ShortcutKey.cs

@@ -4,7 +4,7 @@ using System.Runtime.InteropServices;
 
 namespace BansheeEngine
 {
-    /** @addtogroup GUI-Engine
+    /** @addtogroup GUI_Engine
      *  @{
      */
 

+ 0 - 128
Source/MBansheeEngine/GUI/SpriteTexture.cs

@@ -1,128 +0,0 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-using System;
-using System.Runtime.CompilerServices;
-
-namespace BansheeEngine
-{
-    /** @addtogroup GUI-Engine
-     *  @{
-     */
-
-    /// <summary>
-    /// Texture interface that encapsulates underlying texture which allows us to create a sprite texture atlas 
-    /// (for example multiple sprite textures referencing different parts of a single texture).
-    /// </summary>
-    public sealed class SpriteTexture : Resource
-    {
-        /// <summary>
-        /// Constructor for internal use by the runtime.
-        /// </summary>
-        private SpriteTexture()
-        { }
-
-        /// <summary>
-        /// Creates a new sprite texture that references the entire area of the provided texture.
-        /// </summary>
-        /// <param name="texture">Texture to wrap by the sprite texture.</param>
-        public SpriteTexture(Texture texture)
-        {
-            Vector2 offset = Vector2.Zero;
-            Vector2 scale = Vector2.One;
-
-            Internal_CreateInstance(this, texture, ref offset, ref scale);
-        }
-
-        /// <summary>
-        /// Creates a new sprite texture that references a sub-area of the provided texture.
-        /// </summary>
-        /// <param name="texture">Texture to wrap by the sprite texture.</param>
-        /// <param name="uvOffset">Top-left position of the area used by the sprite texture, in normalized coordinates.
-        ///                        </param>
-        /// <param name="uvScale">Size of the area used by the sprite texture, in normalized coordinates.</param>
-        public SpriteTexture(Texture texture, Vector2 uvOffset, Vector2 uvScale)
-        {
-            Internal_CreateInstance(this, texture, ref uvOffset, ref uvScale);
-        }
-
-        /// <summary>
-        /// Texture that the sprite texture references.
-        /// </summary>
-        public Texture Texture
-        {
-            get { return Internal_GetTexture(mCachedPtr); }
-            set
-            {
-                IntPtr texturePtr = IntPtr.Zero;
-                if (value != null)
-                    texturePtr = value.GetCachedPtr();
-
-                Internal_SetTexture(mCachedPtr, texturePtr);
-            }
-        }
-
-        /// <summary>
-        /// Offset into the referenced texture where the sprite starts. In UV coordinates, range [0, 1].
-        /// </summary>
-        public Vector2 Offset
-        {
-            get { Vector2 value; Internal_GetOffset(mCachedPtr, out value); return value; }
-            set { Internal_SetOffset(mCachedPtr, ref value); }
-        }
-
-        /// <summary>
-        /// Size of the sprite in the referenced texture. In UV coordinates, range [0, 1].
-        /// </summary>
-        public Vector2 Scale
-        {
-            get { Vector2 value; Internal_GetScale(mCachedPtr, out value); return value; }
-            set { Internal_SetScale(mCachedPtr, ref value); }
-        }
-
-        /// <summary>
-        /// Returns width of the sprite texture in pixels.
-        /// </summary>
-        public int Width
-        {
-            get { return Internal_GetWidth(mCachedPtr); }
-        }
-
-        /// <summary>
-        /// Returns height of the sprite texture in pixels.
-        /// </summary>
-        public int Height
-        {
-            get { return Internal_GetHeight(mCachedPtr); }
-        }
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_CreateInstance(SpriteTexture instance, 
-            Texture texture, ref Vector2 offset, ref Vector2 scale);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern Texture Internal_GetTexture(IntPtr thisPtr);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetTexture(IntPtr thisPtr, IntPtr value);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_GetOffset(IntPtr thisPtr, out Vector2 value);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetOffset(IntPtr thisPtr, ref Vector2 value);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_GetScale(IntPtr thisPtr, out Vector2 value);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetScale(IntPtr thisPtr, ref Vector2 value);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern int Internal_GetWidth(IntPtr thisPtr);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern int Internal_GetHeight(IntPtr thisPtr);
-    }
-
-    /** @} */
-}

+ 0 - 141
Source/MBansheeEngine/GUI/StringTable.cs

@@ -1,141 +0,0 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-using System;
-using System.Runtime.CompilerServices;
-
-namespace BansheeEngine
-{
-    /** @addtogroup GUI-Engine
-     *  @{
-     */
-
-    /// <summary>
-    /// Used for string localization. Stores strings and their translations in various languages.
-    /// </summary>
-    public sealed class StringTable : Resource
-    {
-        /// <summary>
-        /// Constructor for runtime use only.
-        /// </summary>
-        /// <param name="dummy">Dummy parameter to differentiate from the normal constructor.</param>
-        private StringTable(bool dummy)
-        {  }
-
-        /// <summary>
-        /// Creates a new empty string table.
-        /// </summary>
-        public StringTable()
-        {
-            Internal_CreateInstance(this);
-        }
-
-        /// <summary>
-        /// Returns the total number of strings in the table.
-        /// </summary>
-        public int StringCount
-        {
-            get { return Internal_GetNumStrings(mCachedPtr); }
-        }
-
-        /// <summary>
-        /// Returns all identifiers that the string table contains localized strings for.
-        /// </summary>
-        public string[] Identifiers
-        {
-            get { return Internal_GetIdentifiers(mCachedPtr); }
-        }
-
-        /// <summary>
-        /// Checks does the string table contain the provided identifier.
-        /// </summary>
-        /// <param name="identifier">Identifier to look for.</param>
-        /// <returns>True if the identifier exists in the table, false otherwise.</returns>
-        public bool Contains(string identifier)
-        {
-            return Internal_Contains(mCachedPtr, identifier);
-        }
-
-        /// <summary>
-        /// Adds or modifies string translation for the specified language.
-        /// </summary>
-        /// <param name="identifier">Identifier of the string to add/modify.</param>
-        /// <param name="language">Language to add/modify the translation for.</param>
-        /// <param name="value">Translated string in the specified language.</param>
-        public void SetString(string identifier, Language language, string value)
-        {
-            Internal_SetString(mCachedPtr, identifier, language, value);
-        }
-
-        /// <summary>
-        /// Adds or modifies string translation for the currently active language.
-        /// </summary>
-        /// <param name="identifier">Identifier of the string to add/modify.</param>
-        /// <param name="value">Translated string in the active language.</param>
-        public void SetString(string identifier, string value)
-        {
-            Internal_SetStringDefault(mCachedPtr, identifier, value);
-        }
-
-        /// <summary>
-        /// Removes the string described by identifier, from all languages.
-        /// </summary>
-        /// <param name="identifier">Identifier of the string to remove.</param>
-        public void RemoveString(string identifier)
-        {
-            Internal_RemoveString(mCachedPtr, identifier);
-        }
-
-        /// <summary>
-        /// Returns a string translation for the specified language.
-        /// </summary>
-        /// <param name="identifier">Identifier of the string to look up.</param>
-        /// <param name="language">Language to retrieve the translation for.</param>
-        /// <returns>String translation for the specified language. Returns the identifier itself if one doesn't exist.
-        /// </returns>
-        public string GetString(string identifier, Language language)
-        {
-            string value;
-            Internal_GetString(mCachedPtr, identifier, language, out value);
-            return value;
-        }
-
-        /// <summary>
-        /// Returns a string translation for the currently active language.
-        /// </summary>
-        /// <param name="identifier">Identifier of the string to look up.</param>
-        /// <returns>String translation for the active language. Returns the identifier itself if one doesn't exist.
-        /// </returns>
-        public string GetString(string identifier)
-        {
-            string value;
-            Internal_GetStringDefault(mCachedPtr, identifier, out value);
-            return value;
-        }
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_CreateInstance(StringTable instance);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern bool Internal_Contains(IntPtr thisPtr, string identifier);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern int Internal_GetNumStrings(IntPtr thisPtr);
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern string[] Internal_GetIdentifiers(IntPtr thisPtr);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetString(IntPtr thisPtr, string identifier, Language language, string value);
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetStringDefault(IntPtr thisPtr, string identifier, string value);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_RemoveString(IntPtr thisPtr, string identifier);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_GetString(IntPtr thisPtr, string identifier, Language language, out string value);
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_GetStringDefault(IntPtr thisPtr, string identifier, out string value);
-    }
-
-    /** @} */
-}

+ 0 - 272
Source/MBansheeEngine/GUI/StringTables.cs

@@ -1,272 +0,0 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-using System;
-using System.Runtime.CompilerServices;
-
-namespace BansheeEngine
-{
-    /** @addtogroup GUI-Engine
-     *  @{
-     */
-
-    /// <summary>
-    /// Manages string tables used for localizing text. Allows you to add and remove different tables and change the 
-    /// active language.
-    /// </summary>
-    public static class StringTables
-    {
-        /// <summary>
-        /// Currently active language that determines the translations retrieved from localized strings.
-        /// </summary>
-        public static Language ActiveLanguage
-        {
-            get
-            {
-                Language value;
-                Internal_GetActiveLanguage(out value);
-                return value;
-            }
-            set
-            {
-                Internal_SetActiveLanguage(value);
-            }
-        }
-
-        /// <summary>
-        /// Returns the string table with the specified id. If the table doesn't exist new one is created.
-        /// </summary>
-        /// <param name="id">Identifier of the string table.</param>
-        /// <returns>String table with the specified identifier.</returns>
-        public static StringTable GetTable(int id)
-        {
-            return Internal_GetTable(id);
-        }
-
-        /// <summary>
-        /// Registers a new string table or replaces an old one at the specified id.
-        /// </summary>
-        /// <param name="id">Id of the string table to add/replace.</param>
-        /// <param name="table">New string table to assign to the specified identifier.</param>
-        public static void RegisterTable(int id, StringTable table)
-        {
-            Internal_SetTable(id, table);
-        }
-
-        /// <summary>
-        /// Removes the string table with the specified id.
-        /// </summary>
-        /// <param name="id">Identifier of the table to remove.</param>
-        public static void UnregisterTable(int id)
-        {
-            Internal_RemoveTable(id);
-        }
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_GetActiveLanguage(out Language value);
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetActiveLanguage(Language value);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern StringTable Internal_GetTable(int id);
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetTable(int id, StringTable table);
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_RemoveTable(int id);
-    }
-
-    /// <summary>
-    /// A set of all languages that localized strings can be translated to. Loosely based on ISO 639-1 two letter language 
-    /// codes.
-    /// </summary>
-    public enum Language
-	{
-		Afar, 
-		Abkhazian, 
-		Avestan, 
-		Afrikaans, 
-		Akan, 
-		Amharic, 
-		Aragonese, 
-		Arabic, 
-		Assamese, 
-		Avaric, 
-		Aymara, 
-		Azerbaijani, 
-		Bashkir, 
-		Belarusian, 
-		Bulgarian, 
-		Bihari, 
-		Bislama, 
-		Bambara, 
-		Bengali, 
-		Tibetan, 
-		Breton, 
-		Bosnian, 
-		Catalan, 
-		Chechen, 
-		Chamorro, 
-		Corsican, 
-		Cree, 
-		Czech, 
-		ChurchSlavic,
-		Chuvash, 
-		Welsh, 
-		Danish, 
-		German, 
-		Maldivian, 
-		Bhutani, 
-		Ewe, 		
-		Greek, 
-		EnglishUK, 
-		EnglishUS,
-		Esperanto, 
-		Spanish, 
-		Estonian, 
-		Basque, 
-		Persian, 
-		Fulah, 
-		Finnish, 
-		Fijian, 
-		Faroese, 
-		French, 
-		WesternFrisian, 
-		Irish, 
-		ScottishGaelic, 
-		Galician, 
-		Guarani, 
-		Gujarati, 
-		Manx, 
-		Hausa, 
-		Hebrew, 
-		Hindi, 
-		HiriMotu, 
-		Croatian, 
-		Haitian, 
-		Hungarian, 
-		Armenian, 
-		Herero, 
-		Interlingua, 
-		Indonesian, 
-		Interlingue, 
-		Igbo, 
-		SichuanYi, 
-		Inupiak, 
-		Ido, 
-		Icelandic, 
-		Italian, 
-		Inuktitut, 
-		Japanese, 
-		Javanese, 
-		Georgian, 
-		Kongo, 
-		Kikuyu, 
-		Kuanyama, 
-		Kazakh, 
-		Kalaallisut, 
-		Cambodian, 
-		Kannada, 
-		Korean, 
-		Kanuri, 
-		Kashmiri, 
-		Kurdish, 
-		Komi, 
-		Cornish, 
-		Kirghiz, 
-		Latin, 
-		Luxembourgish, 
-		Ganda, 
-		Limburgish,
-		Lingala, 
-		Laotian, 
-		Lithuanian, 
-		LubaKatanga, 
-		Latvian,
-		Malagasy, 
-		Marshallese, 
-		Maori, 
-		Macedonian, 
-		Malayalam, 
-		Mongolian, 
-		Moldavian, 
-		Marathi, 
-		Malay, 
-		Maltese, 
-		Burmese, 
-		Nauru, 
-		NorwegianBokmal, 
-		Ndebele, 
-		Nepali, 
-		Ndonga, 
-		Dutch, 
-		NorwegianNynorsk, 
-		Norwegian, 
-		Navaho, 
-		Nyanja, 
-		Provençal, 
-		Ojibwa, 
-		Oromo, 
-		Oriya, 
-		Ossetic, 
-		Punjabi, 
-		Pali, 
-		Polish, 
-		Pushto, 
-		Portuguese, 
-		Quechua, 
-		Romansh, 
-		Kirundi, 
-		Romanian, 
-		Russian, 
-		Kinyarwanda, 
-		Sanskrit, 
-		Sardinian, 
-		Sindhi, 
-		NorthernSami, 
-		Sangro, 
-		Sinhalese, 
-		Slovak, 
-		Slovenian, 
-		Samoan, 
-		Shona, 
-		Somali, 
-		Albanian, 
-		Serbian, 
-		Swati,
-		Sesotho,
-		Sundanese, 
-		Swedish, 
-		Swahili, 
-		Tamil, 
-		Telugu, 
-		Tajik, 
-		Thai, 
-		Tigrinya, 
-		Turkmen, 
-		Tagalog, 
-		Setswana, 
-		Tonga, 
-		Turkish, 
-		Tsonga, 
-		Tatar,
-		Twi, 
-		Tahitian, 
-		Uighur, 
-		Ukrainian, 
-		Urdu, 
-		Uzbek, 
-		Venda, 
-		Vietnamese, 
-		Volapuk, 
-		Walloon, 
-		Wolof, 
-		Xhosa, 
-		Yiddish, 
-		Yoruba, 
-		Zhuang,
-		Chinese,
-		Zulu,
-		Count // Number of entries
-	};
-
-    /** @} */
-}

+ 1 - 1
Source/MBansheeEngine/Interop/Program.cs

@@ -19,7 +19,7 @@ namespace BansheeEngine
      *  Audio clips, 3D sound and music reproduction.
      */
 
-    /** @defgroup GUI-Engine GUI 
+    /** @defgroup GUI_Engine GUI 
      *  Graphical user interface, including elements, styles and localization.
      */
 

+ 0 - 4
Source/MBansheeEngine/MBansheeEngine.csproj

@@ -62,7 +62,6 @@
     <Compile Include="Utility\DirectoryEx.cs" />
     <Compile Include="Serialization\DontSerializeField.cs" />
     <Compile Include="Utility\FileEx.cs" />
-    <Compile Include="GUI\Font.cs" />
     <Compile Include="Scene\GameObject.cs" />
     <Compile Include="GUI\GUIUtility.cs" />
     <Compile Include="GUI\GUIButton.cs" />
@@ -136,9 +135,6 @@
     <Compile Include="Rendering\ShaderInclude.cs" />
     <Compile Include="GUI\ShortcutKey.cs" />
     <Compile Include="Math\Sphere.cs" />
-    <Compile Include="GUI\SpriteTexture.cs" />
-    <Compile Include="GUI\StringTable.cs" />
-    <Compile Include="GUI\StringTables.cs" />
     <Compile Include="Rendering\Texture.cs" />
     <Compile Include="Math\Vector2.cs" />
     <Compile Include="Math\Vector3.cs" />

+ 8 - 14
Source/SBansheeEditor/Wrappers/BsScriptEditorBuiltin.cpp

@@ -5,12 +5,12 @@
 #include "BsMonoClass.h"
 #include "BsMonoMethod.h"
 #include "BsMonoUtil.h"
-#include "Wrappers/BsScriptSpriteTexture.h"
 #include "Wrappers/BsScriptGUIContentImages.h"
 #include "BsScriptResourceManager.h"
-#include "Wrappers/BsScriptFont.h"
 #include "Wrappers/GUI/BsScriptGUISkin.h"
 
+#include "BsScriptSpriteTexture.generated.h"
+
 namespace bs
 {
 	ScriptEditorBuiltin::ScriptEditorBuiltin(MonoObject* instance)
@@ -36,8 +36,7 @@ namespace bs
 	MonoObject* ScriptEditorBuiltin::internal_getLibraryItemIcon(ProjectIcon icon, int size)
 	{
 		HSpriteTexture tex = BuiltinEditorResources::instance().getLibraryIcon(icon, size);
-
-		return ScriptSpriteTexture::toManaged(tex);
+		return ScriptResourceManager::instance().getScriptResource(tex, true)->getManagedInstance();
 	}
 
 	MonoString* ScriptEditorBuiltin::internal_GetEmptyShaderCode()
@@ -57,22 +56,19 @@ namespace bs
 	MonoObject* ScriptEditorBuiltin::internal_GetToolbarIcon(ToolbarIcon icon)
 	{
 		HSpriteTexture tex = BuiltinEditorResources::instance().getToolbarIcon(icon);
-
-		return ScriptSpriteTexture::toManaged(tex);
+		return ScriptResourceManager::instance().getScriptResource(tex, true)->getManagedInstance();
 	}
 
 	MonoObject* ScriptEditorBuiltin::internal_GetLibraryWindowIcon(LibraryWindowIcon icon)
 	{
 		HSpriteTexture tex = BuiltinEditorResources::instance().getLibraryWindowIcon(icon);
-
-		return ScriptSpriteTexture::toManaged(tex);
+		return ScriptResourceManager::instance().getScriptResource(tex, true)->getManagedInstance();
 	}
 
 	MonoObject* ScriptEditorBuiltin::internal_GetInspectorWindowIcon(InspectorWindowIcon icon)
 	{
 		HSpriteTexture tex = BuiltinEditorResources::instance().getInspectorWindowIcon(icon);
-
-		return ScriptSpriteTexture::toManaged(tex);
+		return ScriptResourceManager::instance().getScriptResource(tex, true)->getManagedInstance();
 	}
 
 	MonoObject* ScriptEditorBuiltin::internal_GetSceneWindowIcon(SceneWindowIcon icon)
@@ -92,15 +88,13 @@ namespace bs
 	MonoObject* ScriptEditorBuiltin::internal_GetLogIcon(LogMessageIcon icon, int size, bool dark)
 	{
 		HSpriteTexture tex = BuiltinEditorResources::instance().getLogMessageIcon(icon, size, dark);
-
-		return ScriptSpriteTexture::toManaged(tex);
+		return ScriptResourceManager::instance().getScriptResource(tex, true)->getManagedInstance();
 	}
 
 	MonoObject* ScriptEditorBuiltin::internal_GetEditorIcon(EditorIcon icon)
 	{
 		HSpriteTexture tex = BuiltinEditorResources::instance().getIcon(icon);
-
-		return ScriptSpriteTexture::toManaged(tex);
+		return ScriptResourceManager::instance().getScriptResource(tex, true)->getManagedInstance();
 	}
 	
 	MonoObject* ScriptEditorBuiltin::internal_GetDefaultFont()

+ 2 - 2
Source/SBansheeEditor/Wrappers/BsScriptGizmos.cpp

@@ -3,12 +3,12 @@
 #include "Wrappers/BsScriptGizmos.h"
 #include "BsScriptMeta.h"
 #include "BsMonoClass.h"
-#include "Wrappers/BsScriptSpriteTexture.h"
 #include "Scene/BsGizmoManager.h"
 #include "BsMonoUtil.h"
-#include "Wrappers/BsScriptFont.h"
 
 #include "BsScriptRendererMeshData.generated.h"
+#include "BsScriptSpriteTexture.generated.h"
+#include "BsScriptFont.generated.h"
 
 namespace bs
 {

+ 2 - 1
Source/SBansheeEditor/Wrappers/BsScriptHandleDrawing.cpp

@@ -5,9 +5,10 @@
 #include "BsMonoClass.h"
 #include "Handles/BsHandleManager.h"
 #include "Handles/BsHandleDrawManager.h"
-#include "Wrappers/BsScriptFont.h"
 #include "BsMonoUtil.h"
 
+#include "BsScriptFont.generated.h"
+
 namespace bs
 {
 	void ScriptHandleDrawing::initRuntimeData()

+ 8 - 1
Source/SBansheeEditor/Wrappers/BsScriptImportOptions.cpp

@@ -12,10 +12,10 @@
 #include "Resources/BsScriptCodeImportOptions.h"
 #include "Importer/BsMeshImportOptions.h"
 #include "Renderer/BsRenderer.h"
-#include "Wrappers/BsScriptFont.h"
 #include "Reflection/BsRTTIType.h"
 
 #include "BsScriptAnimationEvent.generated.h"
+#include "BsScriptFont.generated.h"
 
 using namespace std::placeholders;
 
@@ -26,6 +26,13 @@ namespace bs
 		UINT32 start, end;
 	};
 
+	ScriptCharRange::ScriptCharRange(MonoObject* instance)
+		:ScriptObject(instance)
+	{ }
+
+	void ScriptCharRange::initRuntimeData()
+	{ }
+
 	ScriptImportOptionsBase::ScriptImportOptionsBase(MonoObject* instance)
 		:ScriptObjectBase(instance)
 	{ }

+ 10 - 0
Source/SBansheeEditor/Wrappers/BsScriptImportOptions.h

@@ -17,6 +17,16 @@ namespace bs
 
 	enum class FontRenderMode;
 
+	/**	Interop class between C++ & CLR for CharRange. */
+	class BS_SCR_BED_EXPORT ScriptCharRange : public ScriptObject <ScriptCharRange>
+	{
+	public:
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "CharRange")
+
+	private:
+		ScriptCharRange(MonoObject* instance);
+	};
+
 	/** Base class for all C++/CLR interop objects wrapping various implementations of ImportOptions. */
 	class BS_SCR_BED_EXPORT ScriptImportOptionsBase : public ScriptObjectBase
 	{

+ 0 - 59
Source/SBansheeEngine/BsScriptStringTableManager.cpp

@@ -1,59 +0,0 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#include "BsScriptStringTableManager.h"
-#include "BsScriptMeta.h"
-#include "BsMonoField.h"
-#include "BsMonoClass.h"
-#include "BsMonoManager.h"
-#include "BsMonoUtil.h"
-#include "BsScriptResourceManager.h"
-#include "Wrappers/BsScriptStringTable.h"
-
-namespace bs
-{
-	ScriptStringTableManager::ScriptStringTableManager(MonoObject* instance)
-		:ScriptObject(instance)
-	{ }
-
-	void ScriptStringTableManager::initRuntimeData()
-	{
-		metaData.scriptClass->addInternalCall("Internal_GetActiveLanguage", (void*)&ScriptStringTableManager::internal_GetActiveLanguage);
-		metaData.scriptClass->addInternalCall("Internal_SetActiveLanguage", (void*)&ScriptStringTableManager::internal_SetActiveLanguage);
-
-		metaData.scriptClass->addInternalCall("Internal_GetTable", (void*)&ScriptStringTableManager::internal_GetTable);
-		metaData.scriptClass->addInternalCall("Internal_SetTable", (void*)&ScriptStringTableManager::internal_SetTable);
-		metaData.scriptClass->addInternalCall("Internal_RemoveTable", (void*)&ScriptStringTableManager::internal_RemoveTable);
-	}
-
-	void ScriptStringTableManager::internal_GetActiveLanguage(Language* value)
-	{
-		*value = StringTableManager::instance().getActiveLanguage();
-	}
-
-	void ScriptStringTableManager::internal_SetActiveLanguage(Language value)
-	{
-		StringTableManager::instance().setActiveLanguage(value);
-	}
-
-	MonoObject* ScriptStringTableManager::internal_GetTable(UINT32 id)
-	{
-		HStringTable table = StringTableManager::instance().getTable(id);
-
-		ScriptResourceBase* scriptStringTable = ScriptResourceManager::instance().getScriptResource(table, true);
-		return scriptStringTable->getManagedInstance();
-	}
-
-	void ScriptStringTableManager::internal_SetTable(UINT32 id, MonoObject* table)
-	{
-		HStringTable nativeTable;
-		if (table != nullptr)
-			nativeTable = ScriptStringTable::toNative(table)->getHandle();
-
-		StringTableManager::instance().setTable(id, nativeTable);
-	}
-
-	void ScriptStringTableManager::internal_RemoveTable(UINT32 id)
-	{
-		StringTableManager::instance().removeTable(id);
-	}
-}

+ 0 - 37
Source/SBansheeEngine/BsScriptStringTableManager.h

@@ -1,37 +0,0 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#pragma once
-
-#include "BsScriptEnginePrerequisites.h"
-#include "BsScriptObject.h"
-#include "Localization/BsStringTable.h"
-#include "Localization/BsStringTableManager.h"
-
-namespace bs
-{
-	/** @addtogroup ScriptInteropEngine
-	 *  @{
-	 */
-
-	/**	Interop class between C++ & CLR for StringTableManager. */
-	class BS_SCR_BE_EXPORT ScriptStringTableManager : public ScriptObject <ScriptStringTableManager>
-	{
-	public:
-		SCRIPT_OBJ(ENGINE_ASSEMBLY, "BansheeEngine", "StringTables")
-
-	private:
-		ScriptStringTableManager(MonoObject* instance);
-
-		/************************************************************************/
-		/* 								CLR HOOKS						   		*/
-		/************************************************************************/
-		static void internal_GetActiveLanguage(Language* value);
-		static void internal_SetActiveLanguage(Language value);
-
-		static MonoObject* internal_GetTable(UINT32 id);
-		static void internal_SetTable(UINT32 id, MonoObject* table);
-		static void internal_RemoveTable(UINT32 id);
-	};
-
-	/** @} */
-}

+ 0 - 10
Source/SBansheeEngine/CMakeSources.cmake

@@ -9,7 +9,6 @@ set(BS_SBANSHEEENGINE_INC_NOFILTER
 	"BsManagedResourceMetaData.h"
 	"BsManagedResourceManager.h"
 	"BsScriptObjectManager.h"
-	"BsScriptStringTableManager.h"
 	"BsEngineScriptLibrary.h"
 	"BsPlayInEditorManager.h"
 )
@@ -60,8 +59,6 @@ set(BS_SBANSHEEENGINE_INC_WRAPPERS
 	"Wrappers/BsScriptContextMenu.h"
 	"Wrappers/BsScriptCursor.h"
 	"Wrappers/BsScriptDebug.h"
-	"Wrappers/BsScriptFont.h"
-	"Wrappers/BsScriptFontBitmap.h"
 	"Wrappers/BsScriptGameObject.h"
 	"Wrappers/BsScriptGUIContentImages.h"
 	"Wrappers/BsScriptHString.h"
@@ -79,8 +76,6 @@ set(BS_SBANSHEEENGINE_INC_WRAPPERS
 	"Wrappers/BsScriptVector2I.h"
 	"Wrappers/BsScriptVector.h"
 	"Wrappers/BsScriptTime.h"
-	"Wrappers/BsScriptStringTable.h"
-	"Wrappers/BsScriptSpriteTexture.h"
 	"Wrappers/BsScriptShaderInclude.h"
 	"Wrappers/BsScriptSerializableUtility.h"
 	"Wrappers/BsScriptSerializableProperty.h"
@@ -146,8 +141,6 @@ set(BS_SBANSHEEENGINE_SRC_WRAPPERS
 	"Wrappers/BsScriptContextMenu.cpp"
 	"Wrappers/BsScriptCursor.cpp"
 	"Wrappers/BsScriptDebug.cpp"
-	"Wrappers/BsScriptFont.cpp"
-	"Wrappers/BsScriptFontBitmap.cpp"
 	"Wrappers/BsScriptGameObject.cpp"
 	"Wrappers/BsScriptGUIContentImages.cpp"
 	"Wrappers/BsScriptHString.cpp"
@@ -164,8 +157,6 @@ set(BS_SBANSHEEENGINE_SRC_WRAPPERS
 	"Wrappers/BsScriptVector2I.cpp"
 	"Wrappers/BsScriptVector.cpp"
 	"Wrappers/BsScriptTime.cpp"
-	"Wrappers/BsScriptStringTable.cpp"
-	"Wrappers/BsScriptSpriteTexture.cpp"
 	"Wrappers/BsScriptShaderInclude.cpp"
 	"Wrappers/BsScriptSerializableUtility.cpp"
 	"Wrappers/BsScriptSerializableProperty.cpp"
@@ -209,7 +200,6 @@ set(BS_SBANSHEEENGINE_SRC_NOFILTER
 	"BsManagedResourceMetaData.cpp"
 	"BsManagedResourceManager.cpp"
 	"BsScriptObjectManager.cpp"
-	"BsScriptStringTableManager.cpp"
 	"BsEngineScriptLibrary.cpp"
 	"BsPlayInEditorManager.cpp"
 )

+ 0 - 1
Source/SBansheeEngine/Serialization/BsManagedSerializableField.cpp

@@ -7,7 +7,6 @@
 #include "BsMonoManager.h"
 #include "BsScriptResourceManager.h"
 #include "BsScriptGameObjectManager.h"
-#include "Wrappers/BsScriptSpriteTexture.h"
 #include "Wrappers/BsScriptManagedResource.h"
 #include "Wrappers/BsScriptSceneObject.h"
 #include "Wrappers/BsScriptComponent.h"

+ 3 - 5
Source/SBansheeEngine/Serialization/BsScriptAssemblyManager.cpp

@@ -10,8 +10,6 @@
 #include "BsMonoProperty.h"
 #include "Wrappers/BsScriptManagedResource.h"
 #include "Wrappers/BsScriptComponent.h"
-#include "Wrappers/BsScriptSpriteTexture.h"
-
 #include "BsBuiltinComponentLookup.generated.h"
 
 // Note: This resource registration code is only here because resource lookup auto-generation isn't yet hooked up
@@ -32,13 +30,10 @@
 #include "Animation/BsAnimationClip.h"
 
 #include "BsScriptTexture.generated.h"
-#include "Wrappers/BsScriptSpriteTexture.h"
 #include "Wrappers/BsScriptPlainText.h"
 #include "Wrappers/BsScriptScriptCode.h"
 #include "Wrappers/BsScriptShaderInclude.h"
-#include "Wrappers/BsScriptFont.h"
 #include "Wrappers/BsScriptPrefab.h"
-#include "Wrappers/BsScriptStringTable.h"
 #include "Wrappers/GUI/BsScriptGUISkin.h"
 #include "Serialization/BsBuiltinResourceLookup.h"
 
@@ -49,6 +44,9 @@
 #include "BsScriptAudioClip.generated.h"
 #include "BsScriptShader.generated.h"
 #include "BsScriptMaterial.generated.h"
+#include "BsScriptFont.generated.h"
+#include "BsScriptSpriteTexture.generated.h"
+#include "BsScriptStringTable.generated.h"
 
 namespace bs
 {

+ 3 - 2
Source/SBansheeEngine/Wrappers/BsScriptBuiltin.cpp

@@ -6,10 +6,11 @@
 #include "BsMonoMethod.h"
 #include "BsMonoUtil.h"
 #include "Resources/BsBuiltinResources.h"
-#include "Wrappers/BsScriptSpriteTexture.h"
-#include "Wrappers/BsScriptFont.h"
 #include "BsScriptResourceManager.h"
 
+#include "BsScriptFont.generated.h"
+#include "BsScriptSpriteTexture.generated.h"
+
 namespace bs
 {
 	ScriptBuiltin::ScriptBuiltin(MonoObject* instance)

+ 0 - 54
Source/SBansheeEngine/Wrappers/BsScriptFont.cpp

@@ -1,54 +0,0 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#include "Wrappers/BsScriptFont.h"
-#include "BsScriptMeta.h"
-#include "BsMonoField.h"
-#include "BsMonoClass.h"
-#include "BsMonoManager.h"
-#include "BsScriptResourceManager.h"
-#include "Wrappers/BsScriptFontBitmap.h"
-
-namespace bs
-{
-	ScriptFont::ScriptFont(MonoObject* instance, const HFont& font)
-		:TScriptResource(instance, font)
-	{
-
-	}
-
-	void ScriptFont::initRuntimeData()
-	{
-		metaData.scriptClass->addInternalCall("Internal_GetBitmap", (void*)&ScriptFont::internal_GetBitmap);
-		metaData.scriptClass->addInternalCall("Internal_GetClosestSize", (void*)&ScriptFont::internal_GetClosestSize);
-	}
-
-	MonoObject* ScriptFont::internal_GetBitmap(ScriptFont* instance, int size)
-	{
-		HFont font = instance->getHandle();
-
-		SPtr<const FontBitmap> bitmap = font->getBitmap(size);
-		if (bitmap != nullptr)
-			return ScriptFontBitmap::create(bitmap);
-
-		return nullptr;
-	}
-
-	int ScriptFont::internal_GetClosestSize(ScriptFont* instance, int size)
-	{
-		HFont font = instance->getHandle();
-
-		return font->getClosestSize(size);
-	}
-
-	MonoObject* ScriptFont::createInstance()
-	{
-		return metaData.scriptClass->createInstance();
-	}
-
-	ScriptCharRange::ScriptCharRange(MonoObject* instance)
-		:ScriptObject(instance)
-	{ }
-
-	void ScriptCharRange::initRuntimeData()
-	{ }
-}

+ 0 - 48
Source/SBansheeEngine/Wrappers/BsScriptFont.h

@@ -1,48 +0,0 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#pragma once
-
-#include "BsScriptEnginePrerequisites.h"
-#include "Wrappers/BsScriptResource.h"
-#include "BsScriptObject.h"
-#include "Text/BsFont.h"
-
-namespace bs
-{
-	/** @addtogroup ScriptInteropEngine
-	 *  @{
-	 */
-
-	/**	Interop class between C++ & CLR for Font. */
-	class BS_SCR_BE_EXPORT ScriptFont : public TScriptResource<ScriptFont, Font>
-	{
-	public:
-		SCRIPT_OBJ(ENGINE_ASSEMBLY, "BansheeEngine", "Font")
-
-		/**	Creates an empty, uninitialized managed instance of the resource interop object. */
-		static MonoObject* createInstance();
-	private:
-		friend class ScriptResourceManager;
-		friend class BuiltinResourceTypes;
-
-		ScriptFont(MonoObject* instance, const HFont& font);
-
-		/************************************************************************/
-		/* 								CLR HOOKS						   		*/
-		/************************************************************************/
-		static MonoObject* internal_GetBitmap(ScriptFont* instance, int size);
-		static int internal_GetClosestSize(ScriptFont* instance, int size);
-	};
-
-	/**	Interop class between C++ & CLR for CharRange. */
-	class BS_SCR_BE_EXPORT ScriptCharRange : public ScriptObject <ScriptCharRange>
-	{
-	public:
-		SCRIPT_OBJ(ENGINE_ASSEMBLY, "BansheeEngine", "CharRange")
-
-	private:
-		ScriptCharRange(MonoObject* instance);
-	};
-
-	/** @} */
-}

+ 0 - 124
Source/SBansheeEngine/Wrappers/BsScriptFontBitmap.cpp

@@ -1,124 +0,0 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#include "Wrappers/BsScriptFontBitmap.h"
-#include "BsScriptMeta.h"
-#include "BsMonoField.h"
-#include "BsMonoClass.h"
-#include "BsMonoManager.h"
-#include "BsScriptResourceManager.h"
-#include "BsMonoUtil.h"
-
-#include "BsScriptTexture.generated.h"
-
-namespace bs
-{
-	ScriptFontBitmap::ScriptFontBitmap(MonoObject* instance, SPtr<const FontBitmap> bitmap)
-		:ScriptObject(instance), mBitmap(bitmap)
-	{
-
-	}
-
-	void ScriptFontBitmap::initRuntimeData()
-	{
-		metaData.scriptClass->addInternalCall("Internal_GetSize", (void*)&ScriptFontBitmap::internal_GetSize);
-		metaData.scriptClass->addInternalCall("Internal_GetBaselineOffset", (void*)&ScriptFontBitmap::internal_GetBaselineOffset);
-		metaData.scriptClass->addInternalCall("Internal_GetLineHeight", (void*)&ScriptFontBitmap::internal_GetLineHeight);
-		metaData.scriptClass->addInternalCall("Internal_GetSpaceWidth", (void*)&ScriptFontBitmap::internal_GetSpaceWidth);
-		metaData.scriptClass->addInternalCall("Internal_GetMissingChar", (void*)&ScriptFontBitmap::internal_GetMissingChar);
-		metaData.scriptClass->addInternalCall("Internal_GetPages", (void*)&ScriptFontBitmap::internal_GetPages);
-		metaData.scriptClass->addInternalCall("Internal_GetChar", (void*)&ScriptFontBitmap::internal_GetChar);
-		metaData.scriptClass->addInternalCall("Internal_GetKerning", (void*)&ScriptFontBitmap::internal_GetKerning);
-	}
-
-	ScriptCharDesc ScriptFontBitmap::convertCharDesc(const CHAR_DESC& desc)
-	{
-		ScriptCharDesc output;
-
-		output.charId = desc.charId;
-		output.page = desc.page;
-		output.uvX = desc.uvX;
-		output.uvY = desc.uvY;
-		output.uvWidth = desc.uvWidth;
-		output.uvHeight = desc.uvHeight;
-		output.width = desc.width;
-		output.height = desc.height;
-		output.xOffset = desc.xOffset;
-		output.yOffset = desc.yOffset;
-		output.xAdvance = desc.xAdvance;
-		output.yAdvance = desc.yAdvance;
-
-		return output;
-	}
-
-	MonoObject* ScriptFontBitmap::create(SPtr<const FontBitmap> bitmap)
-	{
-		MonoObject* managedInstance = metaData.scriptClass->createInstance();
-		new (bs_alloc<ScriptFontBitmap>()) ScriptFontBitmap(managedInstance, bitmap);
-
-		return managedInstance;
-	}
-
-	UINT32 ScriptFontBitmap::internal_GetSize(ScriptFontBitmap* instance)
-	{
-		return instance->mBitmap->size;
-	}
-
-	INT32 ScriptFontBitmap::internal_GetBaselineOffset(ScriptFontBitmap* instance)
-	{
-		return instance->mBitmap->fontDesc.baselineOffset;
-	}
-
-	UINT32 ScriptFontBitmap::internal_GetLineHeight(ScriptFontBitmap* instance)
-	{
-		return instance->mBitmap->fontDesc.lineHeight;
-	}
-
-	UINT32 ScriptFontBitmap::internal_GetSpaceWidth(ScriptFontBitmap* instance)
-	{
-		return instance->mBitmap->fontDesc.spaceWidth;
-	}
-
-	void ScriptFontBitmap::internal_GetMissingChar(ScriptFontBitmap* instance, ScriptCharDesc* output)
-	{
-		*output = convertCharDesc(instance->mBitmap->fontDesc.missingGlyph);
-	}
-
-	MonoArray* ScriptFontBitmap::internal_GetPages(ScriptFontBitmap* instance)
-	{
-		const Vector<HTexture>& texturePages = instance->mBitmap->texturePages;
-
-		UINT32 numPages = (UINT32)texturePages.size();
-		ScriptArray output = ScriptArray::create<ScriptTexture>(numPages);
-		for (UINT32 i = 0; i < numPages; i++)
-		{
-			ScriptResourceBase* scriptTexture = ScriptResourceManager::instance().getScriptResource(texturePages[i], true);
-			output.set(i, scriptTexture->getManagedInstance());
-		}
-
-		return output.getInternal();
-	}
-
-	void ScriptFontBitmap::internal_GetChar(ScriptFontBitmap* instance, UINT32 id, ScriptCharDesc* output)
-	{
-		*output = convertCharDesc(instance->mBitmap->getCharDesc(id));
-	}
-
-	MonoArray* ScriptFontBitmap::internal_GetKerning(ScriptFontBitmap* instance, UINT32 id)
-	{
-		const CHAR_DESC& charDesc = instance->mBitmap->getCharDesc(id);
-
-		UINT32 numPairs = (UINT32)charDesc.kerningPairs.size();
-		ScriptArray outArray = ScriptArray::create<ScriptKerningPair>(numPairs);
-		for (UINT32 i = 0; i < numPairs; i++)
-			outArray.set(i, charDesc.kerningPairs[i]);
-
-		return outArray.getInternal();
-	}
-
-	ScriptKerningPair::ScriptKerningPair(MonoObject* instance)
-		:ScriptObject(instance)
-	{ }
-
-	void ScriptKerningPair::initRuntimeData()
-	{ }
-}

+ 0 - 75
Source/SBansheeEngine/Wrappers/BsScriptFontBitmap.h

@@ -1,75 +0,0 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#pragma once
-
-#include "BsScriptEnginePrerequisites.h"
-#include "Wrappers/BsScriptResource.h"
-#include "BsScriptObject.h"
-#include "Text/BsFont.h"
-
-namespace bs
-{
-	/** @addtogroup ScriptInteropEngine
-	 *  @{
-	 */
-
-	/**	Describes a single character in a font of a specific size. */
-	struct ScriptCharDesc // Note: Must match C# struct CharDesc
-	{
-		UINT32 charId; /**< Character ID, corresponding to a Unicode key. */
-		UINT32 page; /**< Index of the texture the character is located on. */
-		float uvX, uvY; /**< Texture coordinates of the character in the page texture. */
-		float uvWidth, uvHeight; /**< Width/height of the character in texture coordinates. */
-		UINT32 width, height; /**< Width/height of the character in pixels. */
-		INT32 xOffset, yOffset; /**< Offset for the visible portion of the character in pixels. */
-		INT32 xAdvance, yAdvance; /**< Determines how much to advance the pen after writing this character, in pixels. */
-	};
-
-	/**	Interop class between C++ & CLR for FontBitmap. */
-	class BS_SCR_BE_EXPORT ScriptFontBitmap : public ScriptObject<ScriptFontBitmap>
-	{
-	public:
-		SCRIPT_OBJ(ENGINE_ASSEMBLY, "BansheeEngine", "FontBitmap")
-
-		/**
-		 * Creates a new managed instance of a font bitmap.
-		 *
-		 * @param[in]	bitmap	Native font bitmap to initialize the managed instance with.
-		 */
-		static MonoObject* create(SPtr<const FontBitmap> bitmap);
-
-	private:
-		friend class ScriptResourceManager;
-
-		ScriptFontBitmap(MonoObject* instance, SPtr<const FontBitmap> bitmap);
-
-		/**	Converts the native character description into a script character description. */
-		static ScriptCharDesc convertCharDesc(const CHAR_DESC& desc);
-
-		SPtr<const FontBitmap> mBitmap;
-
-		/************************************************************************/
-		/* 								CLR HOOKS						   		*/
-		/************************************************************************/
-		static UINT32 internal_GetSize(ScriptFontBitmap* instance);
-		static INT32 internal_GetBaselineOffset(ScriptFontBitmap* instance);
-		static UINT32 internal_GetLineHeight(ScriptFontBitmap* instance);
-		static UINT32 internal_GetSpaceWidth(ScriptFontBitmap* instance);
-		static void internal_GetMissingChar(ScriptFontBitmap* instance, ScriptCharDesc* output);
-		static MonoArray* internal_GetPages(ScriptFontBitmap* instance);
-		static void internal_GetChar(ScriptFontBitmap* instance, UINT32 id, ScriptCharDesc* output);
-		static MonoArray* internal_GetKerning(ScriptFontBitmap* instance, UINT32 id);
-	};
-
-	/**	Interop class between C++ & CLR for KerningPair. */
-	class BS_SCR_BE_EXPORT ScriptKerningPair : public ScriptObject <ScriptKerningPair>
-	{
-	public:
-		SCRIPT_OBJ(ENGINE_ASSEMBLY, "BansheeEngine", "KerningPair")
-
-	private:
-		ScriptKerningPair(MonoObject* instance);
-	};
-
-	/** @} */
-}

+ 2 - 1
Source/SBansheeEngine/Wrappers/BsScriptGUIContentImages.cpp

@@ -1,9 +1,10 @@
 //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
 //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
 #include "Wrappers/BsScriptGUIContentImages.h"
-#include "Wrappers/BsScriptSpriteTexture.h"
 #include "BsScriptResourceManager.h"
 
+#include "BsScriptSpriteTexture.generated.h"
+
 namespace bs
 {
 	MonoField* ScriptGUIContentImages::mNormalField;

+ 0 - 147
Source/SBansheeEngine/Wrappers/BsScriptSpriteTexture.cpp

@@ -1,147 +0,0 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#include "Wrappers/BsScriptSpriteTexture.h"
-#include "BsScriptResourceManager.h"
-#include "BsScriptMeta.h"
-#include "BsMonoField.h"
-#include "BsMonoClass.h"
-#include "BsMonoManager.h"
-#include "2D/BsSpriteTexture.h"
-
-#include "BsScriptTexture.generated.h"
-
-namespace bs
-{
-	ScriptSpriteTexture::ScriptSpriteTexture(MonoObject* instance,const HSpriteTexture& texture)
-		:TScriptResource(instance, texture)
-	{
-
-	}
-
-	void ScriptSpriteTexture::initRuntimeData()
-	{
-		metaData.scriptClass->addInternalCall("Internal_CreateInstance", (void*)&ScriptSpriteTexture::internal_createInstance);
-		metaData.scriptClass->addInternalCall("Internal_GetTexture", (void*)&ScriptSpriteTexture::internal_GetTexture);
-		metaData.scriptClass->addInternalCall("Internal_SetTexture", (void*)&ScriptSpriteTexture::internal_SetTexture);
-		metaData.scriptClass->addInternalCall("Internal_GetOffset", (void*)&ScriptSpriteTexture::internal_GetOffset);
-		metaData.scriptClass->addInternalCall("Internal_SetOffset", (void*)&ScriptSpriteTexture::internal_SetOffset);
-		metaData.scriptClass->addInternalCall("Internal_GetScale", (void*)&ScriptSpriteTexture::internal_GetScale);
-		metaData.scriptClass->addInternalCall("Internal_SetScale", (void*)&ScriptSpriteTexture::internal_SetScale);
-		metaData.scriptClass->addInternalCall("Internal_GetWidth", (void*)&ScriptSpriteTexture::internal_GetWidth);
-		metaData.scriptClass->addInternalCall("Internal_GetHeight", (void*)&ScriptSpriteTexture::internal_GetHeight);
-	}
-
-	MonoObject* ScriptSpriteTexture::toManaged(const HSpriteTexture& texture)
-	{
-		if (texture == nullptr)
-			return nullptr;
-
-		ScriptResourceBase* scriptSpriteTex = ScriptResourceManager::instance().getScriptResource(texture, true);
-		return scriptSpriteTex->getManagedInstance();
-	}
-
-	void ScriptSpriteTexture::internal_createInstance(MonoObject* instance, MonoObject* texture, Vector2* offset, Vector2* scale)
-	{
-		ScriptTexture* scriptTexture = ScriptTexture::toNative(texture);
-
-		if (scriptTexture == nullptr)
-			ScriptResourceManager::instance().createBuiltinScriptResource(SpriteTexture::dummy(), instance);
-		else
-		{
-			HSpriteTexture spriteTexture = SpriteTexture::create(*offset, *scale, scriptTexture->getHandle());
-			ScriptResourceManager::instance().createBuiltinScriptResource(spriteTexture, instance);
-		}
-	}
-
-	MonoObject* ScriptSpriteTexture::internal_GetTexture(ScriptSpriteTexture* thisPtr)
-	{
-		HSpriteTexture spriteTexture = thisPtr->getHandle();
-		if (!spriteTexture.isLoaded())
-			return nullptr;
-
-		HTexture texture = spriteTexture->getTexture();
-		if (!texture.isLoaded())
-			return nullptr;
-
-		ScriptResourceBase* scriptTexture = ScriptResourceManager::instance().getScriptResource(texture, true);
-		return scriptTexture->getManagedInstance();
-	}
-
-	void ScriptSpriteTexture::internal_SetTexture(ScriptSpriteTexture* thisPtr, ScriptTexture* value)
-	{
-		HSpriteTexture spriteTexture = thisPtr->getHandle();
-		if (!spriteTexture.isLoaded())
-			return;
-
-		HTexture texture;
-		if (value != nullptr)
-			texture = value->getHandle();
-
-		spriteTexture->setTexture(texture);
-	}
-
-	void ScriptSpriteTexture::internal_GetOffset(ScriptSpriteTexture* thisPtr, Vector2* value)
-	{
-		HSpriteTexture spriteTexture = thisPtr->getHandle();
-		if (!spriteTexture.isLoaded())
-		{
-			*value = Vector2::ZERO;
-			return;
-		}
-		
-		*value = spriteTexture->getOffset();
-	}
-
-	void ScriptSpriteTexture::internal_SetOffset(ScriptSpriteTexture* thisPtr, Vector2* value)
-	{
-		HSpriteTexture spriteTexture = thisPtr->getHandle();
-		if (!spriteTexture.isLoaded())
-			return;
-
-		spriteTexture->setOffset(*value);
-	}
-
-	void ScriptSpriteTexture::internal_GetScale(ScriptSpriteTexture* thisPtr, Vector2* value)
-	{
-		HSpriteTexture spriteTexture = thisPtr->getHandle();
-		if (!spriteTexture.isLoaded())
-		{
-			*value = Vector2::ZERO;
-			return;
-		}
-
-		*value = spriteTexture->getScale();
-	}
-
-	void ScriptSpriteTexture::internal_SetScale(ScriptSpriteTexture* thisPtr, Vector2* value)
-	{
-		HSpriteTexture spriteTexture = thisPtr->getHandle();
-		if (!spriteTexture.isLoaded())
-			return;
-
-		spriteTexture->setScale(*value);
-	}
-
-	UINT32 ScriptSpriteTexture::internal_GetWidth(ScriptSpriteTexture* thisPtr)
-	{
-		HSpriteTexture spriteTexture = thisPtr->getHandle();
-		if (!spriteTexture.isLoaded())
-			return 0;
-
-		return spriteTexture->getWidth();
-	}
-
-	UINT32 ScriptSpriteTexture::internal_GetHeight(ScriptSpriteTexture* thisPtr)
-	{
-		HSpriteTexture spriteTexture = thisPtr->getHandle();
-		if (!spriteTexture.isLoaded())
-			return 0;
-
-		return spriteTexture->getHeight();
-	}
-
-	MonoObject* ScriptSpriteTexture::createInstance()
-	{
-		return metaData.scriptClass->createInstance();
-	}
-}

+ 0 - 48
Source/SBansheeEngine/Wrappers/BsScriptSpriteTexture.h

@@ -1,48 +0,0 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#pragma once
-
-#include "BsScriptEnginePrerequisites.h"
-#include "Wrappers/BsScriptResource.h"
-#include "BsScriptObject.h"
-
-namespace bs
-{
-	/** @addtogroup ScriptInteropEngine
-	 *  @{
-	 */
-
-	/**	Interop class between C++ & CLR for SpriteTexture. */
-	class BS_SCR_BE_EXPORT ScriptSpriteTexture : public TScriptResource<ScriptSpriteTexture, SpriteTexture>
-	{
-	public:
-		SCRIPT_OBJ(ENGINE_ASSEMBLY, "BansheeEngine", "SpriteTexture")
-
-		/**	Creates an empty, uninitialized managed instance of the resource interop object. */
-		static MonoObject* createInstance();
-
-		/**	Returns the native internal sprite texture resource. */
-		static MonoObject* toManaged(const HSpriteTexture& texture);
-
-	private:
-		friend class ScriptResourceManager;
-		friend class BuiltinResourceTypes;
-
-		ScriptSpriteTexture(MonoObject* instance, const HSpriteTexture& texture);
-
-		/************************************************************************/
-		/* 								CLR HOOKS						   		*/
-		/************************************************************************/
-		static void internal_createInstance(MonoObject* instance, MonoObject* texture, Vector2* offset, Vector2* scale);
-		static MonoObject* internal_GetTexture(ScriptSpriteTexture* thisPtr);
-		static void internal_SetTexture(ScriptSpriteTexture* thisPtr, ScriptTexture* value);
-		static void internal_GetOffset(ScriptSpriteTexture* thisPtr, Vector2* value);
-		static void internal_SetOffset(ScriptSpriteTexture* thisPtr, Vector2* value);
-		static void internal_GetScale(ScriptSpriteTexture* thisPtr, Vector2* value);
-		static void internal_SetScale(ScriptSpriteTexture* thisPtr, Vector2* value);
-		static UINT32 internal_GetWidth(ScriptSpriteTexture* thisPtr);
-		static UINT32 internal_GetHeight(ScriptSpriteTexture* thisPtr);
-	};
-
-	/** @} */
-}

+ 0 - 124
Source/SBansheeEngine/Wrappers/BsScriptStringTable.cpp

@@ -1,124 +0,0 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#include "Wrappers/BsScriptStringTable.h"
-#include "BsScriptMeta.h"
-#include "BsMonoField.h"
-#include "BsMonoClass.h"
-#include "BsMonoManager.h"
-#include "BsMonoUtil.h"
-#include "BsScriptResourceManager.h"
-#include "Localization/BsStringTableManager.h"
-
-namespace bs
-{
-	ScriptStringTable::ScriptStringTable(MonoObject* instance, const HStringTable& table)
-		:TScriptResource(instance, table)
-	{ }
-
-	void ScriptStringTable::initRuntimeData()
-	{
-		metaData.scriptClass->addInternalCall("Internal_CreateInstance", (void*)&ScriptStringTable::internal_CreateInstance);
-
-		metaData.scriptClass->addInternalCall("Internal_GetNumStrings", (void*)&ScriptStringTable::internal_GetNumStrings);
-		metaData.scriptClass->addInternalCall("Internal_GetIdentifiers", (void*)&ScriptStringTable::internal_GetIdentifiers);
-		metaData.scriptClass->addInternalCall("Internal_Contains", (void*)&ScriptStringTable::internal_Contains);
-
-		metaData.scriptClass->addInternalCall("Internal_SetString", (void*)&ScriptStringTable::internal_SetString);
-		metaData.scriptClass->addInternalCall("Internal_SetStringDefault", (void*)&ScriptStringTable::internal_SetStringDefault);
-		metaData.scriptClass->addInternalCall("Internal_RemoveString", (void*)&ScriptStringTable::internal_RemoveString);
-		metaData.scriptClass->addInternalCall("Internal_GetString", (void*)&ScriptStringTable::internal_GetString);
-		metaData.scriptClass->addInternalCall("Internal_GetStringDefault", (void*)&ScriptStringTable::internal_GetStringDefault);
-	}
-
-	void ScriptStringTable::internal_CreateInstance(MonoObject* instance)
-	{
-		HStringTable stringTable = StringTable::create();
-		ScriptResourceManager::instance().createBuiltinScriptResource(stringTable, instance);
-	}
-
-	bool ScriptStringTable::internal_Contains(ScriptStringTable* thisPtr, MonoString* identifier)
-	{
-		WString nativeIdentifier = MonoUtil::monoToWString(identifier);
-
-		auto& identifiers = thisPtr->getHandle()->getIdentifiers();
-		return identifiers.find(nativeIdentifier) != identifiers.end();
-	}
-
-	UINT32 ScriptStringTable::internal_GetNumStrings(ScriptStringTable* thisPtr)
-	{
-		return (UINT32)thisPtr->getHandle()->getIdentifiers().size();
-	}
-
-	MonoArray* ScriptStringTable::internal_GetIdentifiers(ScriptStringTable* thisPtr)
-	{
-		const UnorderedSet<WString>& identifiers = thisPtr->getHandle()->getIdentifiers();
-		UINT32 numIdentifiers = (UINT32)identifiers.size();
-
-		ScriptArray outArray = ScriptArray::create<WString>(numIdentifiers);
-		UINT32 idx = 0;
-		for (auto identifier : identifiers)
-		{
-			outArray.set(idx, identifier);
-
-			idx++;
-		}
-
-		return outArray.getInternal();
-	}
-
-	void ScriptStringTable::internal_SetString(ScriptStringTable* thisPtr, MonoString* identifier, Language language, MonoString* value)
-	{
-		WString nativeIdentifier = MonoUtil::monoToWString(identifier);
-		WString nativeValue = MonoUtil::monoToWString(value);
-
-		thisPtr->getHandle()->setString(nativeIdentifier, language, nativeValue);
-	}
-
-	void ScriptStringTable::internal_SetStringDefault(ScriptStringTable* thisPtr, MonoString* identifier, MonoString* value)
-	{
-		WString nativeIdentifier = MonoUtil::monoToWString(identifier);
-		WString nativeValue = MonoUtil::monoToWString(value);
-
-		thisPtr->getHandle()->setString(nativeIdentifier, StringTableManager::instance().getActiveLanguage(), nativeValue);
-	}
-
-	void ScriptStringTable::internal_RemoveString(ScriptStringTable* thisPtr, MonoString* identifier)
-	{
-		WString nativeIdentifier = MonoUtil::monoToWString(identifier);
-		thisPtr->getHandle()->removeString(nativeIdentifier);
-	}
-
-	void ScriptStringTable::internal_GetString(ScriptStringTable* thisPtr, MonoString* identifier, Language language, MonoString** value)
-	{
-		WString nativeIdentifier = MonoUtil::monoToWString(identifier);
-		WString nativeValue = thisPtr->getHandle()->getString(nativeIdentifier, language);
-
-		*value = MonoUtil::wstringToMono(nativeValue);
-	}
-
-	void ScriptStringTable::internal_GetStringDefault(ScriptStringTable* thisPtr, MonoString* identifier, MonoString** value)
-	{
-		WString nativeIdentifier = MonoUtil::monoToWString(identifier);
-		WString nativeValue = thisPtr->getHandle()->getString(nativeIdentifier, StringTableManager::instance().getActiveLanguage());
-
-		*value = MonoUtil::wstringToMono(nativeValue);
-	}
-
-	MonoObject* ScriptStringTable::createInstance()
-	{
-		bool dummy = false;
-
-		void* params[1];
-		params[0] = &dummy;
-
-		return metaData.scriptClass->createInstance("bool", params);
-	}
-
-	MonoObject* ScriptStringTable::_createManagedInstance(bool construct)
-	{
-		if (construct)
-			return createInstance();
-
-		return metaData.scriptClass->createInstance(false);
-	}
-}

+ 0 - 52
Source/SBansheeEngine/Wrappers/BsScriptStringTable.h

@@ -1,52 +0,0 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#pragma once
-
-#include "BsScriptEnginePrerequisites.h"
-#include "Wrappers/BsScriptResource.h"
-#include "Localization/BsStringTable.h"
-
-namespace bs
-{
-	/** @addtogroup ScriptInteropEngine
-	 *  @{
-	 */
-
-	/**	Interop class between C++ & CLR for StringTable. */
-	class BS_SCR_BE_EXPORT ScriptStringTable : public TScriptResource <ScriptStringTable, StringTable>
-	{
-	public:
-		SCRIPT_OBJ(ENGINE_ASSEMBLY, "BansheeEngine", "StringTable")
-
-		/**	Creates an empty, uninitialized managed instance of the resource interop object. */
-		static MonoObject* createInstance();
-
-	private:
-		friend class ScriptResourceManager;
-		friend class BuiltinResourceTypes;
-
-		ScriptStringTable(MonoObject* instance, const HStringTable& table);
-
-		/** @copydoc ScriptObjectBase::_createManagedInstance */
-		MonoObject* _createManagedInstance(bool construct) override;
-
-		/************************************************************************/
-		/* 								CLR HOOKS						   		*/
-		/************************************************************************/
-		static void internal_CreateInstance(MonoObject* instance);
-		static bool internal_Contains(ScriptStringTable* thisPtr, MonoString* identifier);
-
-		static UINT32 internal_GetNumStrings(ScriptStringTable* thisPtr);
-		static MonoArray* internal_GetIdentifiers(ScriptStringTable* thisPtr);
-
-		static void internal_SetString(ScriptStringTable* thisPtr, MonoString* identifier, Language language, MonoString* value);
-		static void internal_SetStringDefault(ScriptStringTable* thisPtr, MonoString* identifier, MonoString* value);
-
-		static void internal_RemoveString(ScriptStringTable* thisPtr, MonoString* identifier);
-
-		static void internal_GetString(ScriptStringTable* thisPtr, MonoString* identifier, Language language, MonoString** value);
-		static void internal_GetStringDefault(ScriptStringTable* thisPtr, MonoString* identifier, MonoString** value);
-	};
-
-	/** @} */
-}

+ 3 - 2
Source/SBansheeEngine/Wrappers/GUI/BsScriptGUICanvas.cpp

@@ -2,12 +2,13 @@
 //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
 #include "Wrappers/GUI/BsScriptGUICanvas.h"
 #include "BsScriptMeta.h"
-#include "Wrappers/BsScriptSpriteTexture.h"
 #include "BsMonoUtil.h"
 #include "GUI/BsGUILayout.h"
 #include "GUI/BsGUICanvas.h"
 #include "GUI/BsGUIOptions.h"
-#include "Wrappers/BsScriptFont.h"
+
+#include "BsScriptFont.generated.h"
+#include "BsScriptSpriteTexture.generated.h"
 
 namespace bs
 {

+ 0 - 1
Source/SBansheeEngine/Wrappers/GUI/BsScriptGUIContent.cpp

@@ -7,7 +7,6 @@
 #include "BsMonoManager.h"
 #include "BsMonoUtil.h"
 #include "Wrappers/BsScriptHString.h"
-#include "Wrappers/BsScriptSpriteTexture.h"
 #include "2D/BsSpriteTexture.h"
 #include "Wrappers/BsScriptGUIContentImages.h"
 

+ 2 - 1
Source/SBansheeEngine/Wrappers/GUI/BsScriptGUIElementStateStyle.cpp

@@ -5,11 +5,12 @@
 #include "BsMonoField.h"
 #include "BsMonoClass.h"
 #include "BsMonoManager.h"
-#include "Wrappers/BsScriptSpriteTexture.h"
 #include "BsScriptResourceManager.h"
 #include "GUI/BsGUIElementStyle.h"
 #include "Wrappers/BsScriptColor.h"
 
+#include "BsScriptSpriteTexture.generated.h"
+
 namespace bs
 {
 	ScriptGUIElementStateStyle::ScriptGUIElementStateStyle(MonoObject* instance)

+ 2 - 1
Source/SBansheeEngine/Wrappers/GUI/BsScriptGUIElementStyle.cpp

@@ -5,13 +5,14 @@
 #include "BsMonoField.h"
 #include "BsMonoClass.h"
 #include "BsMonoManager.h"
-#include "Wrappers/BsScriptFont.h"
 #include "Error/BsException.h"
 #include "GUI/BsGUIElementStyle.h"
 #include "Wrappers/GUI/BsScriptGUIElementStateStyle.h"
 #include "BsMonoUtil.h"
 #include "BsScriptResourceManager.h"
 
+#include "BsScriptFont.generated.h"
+
 namespace bs
 {
 	ScriptGUIElementStyle::ScriptGUIElementStyle(MonoObject* instance)

+ 0 - 3
Source/SBansheeEngine/Wrappers/GUI/BsScriptGUIScrollArea.cpp

@@ -10,11 +10,8 @@
 #include "GUI/BsGUILayout.h"
 #include "GUI/BsGUIScrollArea.h"
 #include "GUI/BsGUIOptions.h"
-#include "Wrappers/BsScriptSpriteTexture.h"
 #include "Wrappers/GUI/BsScriptGUIElementStyle.h"
 #include "Wrappers/GUI/BsScriptGUILayout.h"
-#include "Wrappers/BsScriptHString.h"
-#include "Wrappers/GUI/BsScriptGUIContent.h"
 
 namespace bs
 {

+ 2 - 1
Source/SBansheeEngine/Wrappers/GUI/BsScriptGUITexture.cpp

@@ -10,12 +10,13 @@
 #include "GUI/BsGUILayout.h"
 #include "GUI/BsGUITexture.h"
 #include "GUI/BsGUIOptions.h"
-#include "Wrappers/BsScriptSpriteTexture.h"
 #include "Wrappers/GUI/BsScriptGUIElementStyle.h"
 #include "Wrappers/GUI/BsScriptGUILayout.h"
 #include "Wrappers/BsScriptHString.h"
 #include "Wrappers/GUI/BsScriptGUIContent.h"
 
+#include "BsScriptSpriteTexture.generated.h"
+
 namespace bs
 {
 	ScriptGUITexture::ScriptGUITexture(MonoObject* instance, GUITexture* texture)

+ 2 - 1
Source/SBansheeEngine/Wrappers/GUI/BsScriptGUIUtility.cpp

@@ -12,7 +12,8 @@
 #include "Wrappers/GUI/BsScriptGUILayout.h"
 #include "GUI/BsGUILayoutUtility.h"
 #include "GUI/BsGUIHelper.h"
-#include "Wrappers/BsScriptFont.h"
+
+#include "BsScriptFont.generated.h"
 
 namespace bs
 {