diff options
author | johndoe123 | 2014-04-11 09:40:54 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2018-07-20 06:43:33 +0000 |
commit | 2e149cf651ee9344ee96ea904c5dce5a444aeaff (patch) | |
tree | 5fb2c760d303a4db0856cbc4de7c94609d8b4238 /engines/illusions/textdrawer.h | |
parent | 67366aa04b723fadec300cc6ce1d5c6ee9241af7 (diff) | |
download | scummvm-rg350-2e149cf651ee9344ee96ea904c5dce5a444aeaff.tar.gz scummvm-rg350-2e149cf651ee9344ee96ea904c5dce5a444aeaff.tar.bz2 scummvm-rg350-2e149cf651ee9344ee96ea904c5dce5a444aeaff.zip |
ILLUSIONS: More work on Duckman
- Implement Duckman cursor and interaction handling
- Add more script opcodes
- Add TextDrawer and ScreenText (needs minor refactoring for BBDOU)
Diffstat (limited to 'engines/illusions/textdrawer.h')
-rw-r--r-- | engines/illusions/textdrawer.h | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/engines/illusions/textdrawer.h b/engines/illusions/textdrawer.h new file mode 100644 index 0000000000..a5f6102d28 --- /dev/null +++ b/engines/illusions/textdrawer.h @@ -0,0 +1,68 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#ifndef ILLUSIONS_TEXTDRAWER_H +#define ILLUSIONS_TEXTDRAWER_H + +#include "illusions/graphics.h" +#include "illusions/fontresource.h" +#include "common/array.h" +#include "common/rect.h" +#include "graphics/surface.h" + +namespace Illusions { + +class IllusionsEngine; + +struct TextLine { + uint16 *_text; + int16 _length; + int16 _x, _y; + TextLine() : _text(0) {} + TextLine(uint16 *text, int16 length, int16 x, int16 y) + : _text(text), _length(length), _x(x), _y(y) {} +}; + +class TextDrawer { +public: + bool wrapText(FontResource *font, uint16 *text, WidthHeight *dimensions, Common::Point offsPt, + uint textFlags, uint16 *&outTextPtr); + void drawText(Screen *screen, Graphics::Surface *surface, uint16 color2, uint16 color1); +protected: + FontResource *_font; + uint16 *_text; + WidthHeight *_dimensions; + Common::Point _offsPt; + uint _textFlags; + Graphics::Surface *_surface; + + Common::Array<TextLine> _textLines; + + bool textHasChar(uint16 c); + int16 getSpaceWidth(); + int16 getCharWidth(uint16 c); + bool wrapTextIntern(int16 x, int16 y, int16 maxWidth, int16 maxHeight, uint16 *&outTextPtr); +}; + +} // End of namespace Illusions + +#endif // ILLUSIONS_TALKRESOURCE_H |