diff options
author | Eric Fry | 2018-04-26 23:29:37 +1000 |
---|---|---|
committer | Eugene Sandulenko | 2018-07-20 06:43:33 +0000 |
commit | 8e462f313fa195ce532a7a684d17a487cbdd4613 (patch) | |
tree | a88de07fd4c69dbe85998cbfb553373498793316 /engines/illusions | |
parent | a6cd908e0efd17fe0835f929953c4e1260ac297b (diff) | |
download | scummvm-rg350-8e462f313fa195ce532a7a684d17a487cbdd4613.tar.gz scummvm-rg350-8e462f313fa195ce532a7a684d17a487cbdd4613.tar.bz2 scummvm-rg350-8e462f313fa195ce532a7a684d17a487cbdd4613.zip |
ILLUSIONS: Work on menu border decoration
Diffstat (limited to 'engines/illusions')
-rw-r--r-- | engines/illusions/menusystem.cpp | 6 | ||||
-rw-r--r-- | engines/illusions/resources/fontresource.h | 4 | ||||
-rw-r--r-- | engines/illusions/screentext.cpp | 4 | ||||
-rw-r--r-- | engines/illusions/textdrawer.cpp | 19 |
4 files changed, 25 insertions, 8 deletions
diff --git a/engines/illusions/menusystem.cpp b/engines/illusions/menusystem.cpp index 266d0b9c2c..5002484190 100644 --- a/engines/illusions/menusystem.cpp +++ b/engines/illusions/menusystem.cpp @@ -258,11 +258,9 @@ void BaseMenuSystem::placeActorHoverBackground() { WidthHeight textInfoDimensions; _vm->_screenText->getTextInfoDimensions(textInfoDimensions); - /* TODO if ( _activeMenu->_field8 && _activeMenu->_fieldA != _activeMenu->_field8) textInfoDimensions._width -= 6; - */ - + WidthHeight frameDimensions; v0->getActorFrameDimensions(frameDimensions); @@ -312,12 +310,10 @@ void BaseMenuSystem::placeActorTextColorRect() { _vm->_screenText->getTextInfoPosition(textInfoPosition); _vm->_screenText->getTextInfoDimensions(textInfoDimensions); - /* TODO if (_activeMenu->_field8 && _activeMenu->_fieldA != _activeMenu->_field8) { textInfoDimensions._width -= 2; textInfoDimensions._height -= 6; } - */ v0->setActorPosition(textInfoPosition); v0->drawActorRect(Common::Rect(textInfoDimensions._width - 1, textInfoDimensions._height - 1), _activeMenu->_textColor); diff --git a/engines/illusions/resources/fontresource.h b/engines/illusions/resources/fontresource.h index fa758bc4f1..6204c9df8b 100644 --- a/engines/illusions/resources/fontresource.h +++ b/engines/illusions/resources/fontresource.h @@ -81,11 +81,11 @@ public: class FontInstance : public ResourceInstance { public: - FontInstance(IllusionsEngine *vm); + FontInstance(IllusionsEngine *vm); virtual void load(Resource *resource); virtual void unload(); public: - IllusionsEngine *_vm; + IllusionsEngine *_vm; FontResource *_fontResource; uint32 _resId; }; diff --git a/engines/illusions/screentext.cpp b/engines/illusions/screentext.cpp index 0a91570859..0894330a55 100644 --- a/engines/illusions/screentext.cpp +++ b/engines/illusions/screentext.cpp @@ -88,6 +88,10 @@ bool ScreenText::refreshScreenText(FontResource *font, WidthHeight dimensions, C uint16 *text, uint textFlags, uint16 color2, uint16 color1, uint16 *&outTextPtr) { TextDrawer textDrawer; bool done = textDrawer.wrapText(font, text, &dimensions, offsPt, textFlags, outTextPtr); + if (textFlags & TEXT_FLAG_BORDER_DECORATION) { + dimensions._width += 11; + dimensions._height += 14; + } _surface = _vm->_screen->allocSurface(dimensions._width, dimensions._height); _surface->fillRect(Common::Rect(0, 0, _surface->w, _surface->h), _vm->_screen->getColorKey1()); _dimensions = dimensions; diff --git a/engines/illusions/textdrawer.cpp b/engines/illusions/textdrawer.cpp index 1d1ac5797f..e743330434 100644 --- a/engines/illusions/textdrawer.cpp +++ b/engines/illusions/textdrawer.cpp @@ -43,10 +43,27 @@ bool TextDrawer::wrapText(FontResource *font, uint16 *text, WidthHeight *dimensi void TextDrawer::drawText(Screen *screen, Graphics::Surface *surface, uint16 color2, uint16 color1) { // TODO Fill box, draw borders and shadow if flags are set + uint16 x = 0; + uint16 y = 0; + + if (_textFlags & TEXT_FLAG_BORDER_DECORATION) { + surface->frameRect(Common::Rect(0, 0, surface->w - 3, surface->h - 6), color1); + + surface->fillRect(Common::Rect(1, 1, surface->w - 4, 4), color2); + surface->fillRect(Common::Rect(1, surface->h - 10, surface->w - 4, surface->h - 7), color2); + surface->fillRect(Common::Rect(1, 4, 4, surface->h - 10), color2); + surface->fillRect(Common::Rect(surface->w - 7, 4, surface->w - 4, surface->h - 10), color2); + + surface->fillRect(Common::Rect(3, surface->h - 7, surface->w, surface->h), color1); + surface->fillRect(Common::Rect(surface->w - 3, 6, surface->w, surface->h), color1); + x = 4; + y = 4; + } + for (Common::Array<TextLine>::iterator it = _textLines.begin(); it != _textLines.end(); ++it) { const TextLine &textLine = *it; if (textLine._text) - screen->drawText(_font, surface, textLine._x, textLine._y, textLine._text, textLine._length); + screen->drawText(_font, surface, textLine._x + x, textLine._y + y, textLine._text, textLine._length); #if 0 for (int16 linePos = 0; linePos < textLine._length; ++linePos) { const uint16 c = textLine._text[linePos]; |