diff options
author | Miroslav Remák | 2018-07-17 11:22:25 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2018-08-25 23:12:01 +0200 |
commit | f94ff7aa8ec510de8dc353c9c2e079db5e05d5da (patch) | |
tree | 56a636e1fc16b7176c043d7579ecb38844e053e6 /engines/mutationofjb/font.h | |
parent | f70eb01061d3e5dd74ed8065d0435a4273d973dc (diff) | |
download | scummvm-rg350-f94ff7aa8ec510de8dc353c9c2e079db5e05d5da.tar.gz scummvm-rg350-f94ff7aa8ec510de8dc353c9c2e079db5e05d5da.tar.bz2 scummvm-rg350-f94ff7aa8ec510de8dc353c9c2e079db5e05d5da.zip |
MUTATIONOFJB: Implement word wrapping for subtitles.
Diffstat (limited to 'engines/mutationofjb/font.h')
-rw-r--r-- | engines/mutationofjb/font.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/engines/mutationofjb/font.h b/engines/mutationofjb/font.h index 5aa6a4fb78..a27303eb0d 100644 --- a/engines/mutationofjb/font.h +++ b/engines/mutationofjb/font.h @@ -37,17 +37,20 @@ class Font { public: Font(const Common::String &fileName, int horizSpacing, int vertSpacing); virtual ~Font() {} - void drawString(const Common::String &str, uint8 baseColor, int16 x, int16 y, Graphics::ManagedSurface &surf); + int getLineHeight() const; + int16 getWidth(const Common::String &text) const; + void drawString(const Common::String &str, uint8 baseColor, int16 x, int16 y, Graphics::ManagedSurface &surf) const; + void wordWrap(const Common::String &str, int16 maxLineWidth, Common::Array<Common::String> &lines) const; protected: - virtual uint8 transformColor(uint8 baseColor, uint8 glyphColor); + virtual uint8 transformColor(uint8 baseColor, uint8 glyphColor) const; private: - void drawGlyph(uint8 glyph, uint8 baseColor, int16 &x, int16 &y, Graphics::ManagedSurface &surf); + void drawGlyph(uint8 glyph, uint8 baseColor, int16 &x, int16 &y, Graphics::ManagedSurface &surf) const; bool load(const Common::String &fileName); int _horizSpacing; - int _vertSpacing; + int _lineHeight; typedef Common::HashMap<uint8, Graphics::ManagedSurface> GlyphMap; GlyphMap _glyphs; }; @@ -62,7 +65,7 @@ public: SpeechFont(); protected: - virtual uint8 transformColor(uint8 baseColor, uint8 glyphColor) override; + virtual uint8 transformColor(uint8 baseColor, uint8 glyphColor) const override; }; } |