From acba8f9254a724ce9c57f5ddd81e6b9264c07274 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 16 Mar 2014 23:40:21 -0400 Subject: MADS: Implementing user interface text display methods --- engines/mads/font.h | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) (limited to 'engines/mads/font.h') diff --git a/engines/mads/font.h b/engines/mads/font.h index c642831952..9b3e5bc828 100644 --- a/engines/mads/font.h +++ b/engines/mads/font.h @@ -41,38 +41,42 @@ namespace MADS { class MADSEngine; class Font { -protected: - MADSEngine *_vm; +private: + static uint8 _fontColors[4]; + static MADSEngine *_vm; +public: + /** + * Initialise the font system + */ + static void init(MADSEngine *vm); + /** + * Returns a new Font instance using the specified font name + */ + static Font *getFont(const Common::String &fontName); +protected: uint8 _maxWidth, _maxHeight; uint8 *_charWidths; uint16 *_charOffs; uint8 *_charData; bool _sysFont; Common::String _filename; - uint8 _fontColors[4]; int getBpp(int charWidth); public: - Font(MADSEngine *vm); + Font(); virtual ~Font(); void setFont(const Common::String &filename); void setColor(uint8 color); void setColors(uint8 v1, uint8 v2, uint8 v3, uint8 v4); + void setColorMode(int mode); int maxWidth() const { return _maxWidth; } int getWidth(const Common::String &msg, int spaceWidth = -1); int getHeight() const { return _maxHeight; } - int write(MSurface *surface, const Common::String &msg, const Common::Point &pt, int width, int spaceWidth, uint8 colors[]); - int writeString(MSurface *surface, const Common::String &msg, const Common::Point &pt, int width = 0, int spaceWidth = -1) { - return write(surface, msg, pt, width, spaceWidth, _fontColors); - } - - /** - * Returns a new Font instance using the specified font name - */ - Font *getFont(const Common::String &fontName); + int writeString(MSurface *surface, const Common::String &msg, const Common::Point &pt, + int spaceWidth = 0, int width = 0); }; } // End of namespace MADS -- cgit v1.2.3