diff options
Diffstat (limited to 'src/graphics/engine/text.h')
-rw-r--r-- | src/graphics/engine/text.h | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/graphics/engine/text.h b/src/graphics/engine/text.h index 57fad43..6bcc59b 100644 --- a/src/graphics/engine/text.h +++ b/src/graphics/engine/text.h @@ -31,9 +31,6 @@ #include <map> -class CInstanceManager; - - // Graphics module namespace namespace Gfx { @@ -226,7 +223,7 @@ struct MultisizeFont class CText { public: - CText(CInstanceManager *iMan, CEngine* engine); + CText(CEngine* engine); virtual ~CText(); //! Sets the device to be used @@ -244,7 +241,8 @@ public: void FlushCache(); //! Draws text (multi-format) - void DrawText(const std::string &text, std::map<unsigned int, FontMetaChar> &format, + void DrawText(const std::string &text, std::vector<FontMetaChar>::iterator format, + std::vector<FontMetaChar>::iterator end, float size, Math::Point pos, float width, TextAlign align, int eol, Color color = Color(0.0f, 0.0f, 0.0f, 1.0f)); //! Draws text (one font) @@ -253,7 +251,8 @@ public: int eol, Color color = Color(0.0f, 0.0f, 0.0f, 1.0f)); //! Calculates dimensions for text (multi-format) - void SizeText(const std::string &text, std::map<unsigned int, FontMetaChar> &format, + void SizeText(const std::string &text, std::vector<FontMetaChar>::iterator format, + std::vector<FontMetaChar>::iterator endFormat, float size, Math::Point pos, TextAlign align, Math::Point &start, Math::Point &end); //! Calculates dimensions for text (one font) @@ -270,20 +269,23 @@ public: //! Returns width of string (multi-format) TEST_VIRTUAL float GetStringWidth(const std::string &text, - std::map<unsigned int, FontMetaChar> &format, float size); + std::vector<FontMetaChar>::iterator format, + std::vector<FontMetaChar>::iterator end, float size); //! Returns width of string (single font) TEST_VIRTUAL float GetStringWidth(const std::string &text, FontType font, float size); //! Returns width of single character TEST_VIRTUAL float GetCharWidth(UTF8Char ch, FontType font, float size, float offset); //! Justifies a line of text (multi-format) - int Justify(const std::string &text, std::map<unsigned int, FontMetaChar> &format, + int Justify(const std::string &text, std::vector<FontMetaChar>::iterator format, + std::vector<FontMetaChar>::iterator end, float size, float width); //! Justifies a line of text (one font) int Justify(const std::string &text, FontType font, float size, float width); //! Returns the most suitable position to a given offset (multi-format) - int Detect(const std::string &text, std::map<unsigned int, FontMetaChar> &format, + int Detect(const std::string &text, std::vector<FontMetaChar>::iterator format, + std::vector<FontMetaChar>::iterator end, float size, float offset); //! Returns the most suitable position to a given offset (one font) int Detect(const std::string &text, FontType font, float size, float offset); @@ -292,7 +294,8 @@ protected: CachedFont* GetOrOpenFont(FontType type, float size); CharTexture CreateCharTexture(UTF8Char ch, CachedFont* font); - void DrawString(const std::string &text, std::map<unsigned int, FontMetaChar> &format, + void DrawString(const std::string &text, std::vector<FontMetaChar>::iterator format, + std::vector<FontMetaChar>::iterator end, float size, Math::Point pos, float width, int eol, Color color); void DrawString(const std::string &text, FontType font, float size, Math::Point pos, float width, int eol, Color color); @@ -301,7 +304,6 @@ protected: void StringToUTFCharList(const std::string &text, std::vector<UTF8Char> &chars); protected: - CInstanceManager* m_iMan; CEngine* m_engine; CDevice* m_device; |