diff options
author | Dmitry Iskrich | 2016-07-03 16:48:38 +0300 |
---|---|---|
committer | Eugene Sandulenko | 2016-08-03 23:40:36 +0200 |
commit | 260c44beed4c67f3576503e6a22daad955ec2af5 (patch) | |
tree | f706eecfcf49ac1271e05a800c7da60a7435e088 | |
parent | 3cf8510c418ae6fd9683691c8da01aba062c3367 (diff) | |
download | scummvm-rg350-260c44beed4c67f3576503e6a22daad955ec2af5.tar.gz scummvm-rg350-260c44beed4c67f3576503e6a22daad955ec2af5.tar.bz2 scummvm-rg350-260c44beed4c67f3576503e6a22daad955ec2af5.zip |
DIRECTOR: Handle text gutter/border box
-rw-r--r-- | engines/director/score.cpp | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/engines/director/score.cpp b/engines/director/score.cpp index cfce7a4b6e..655cf91340 100644 --- a/engines/director/score.cpp +++ b/engines/director/score.cpp @@ -1340,6 +1340,45 @@ void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteID) { } font->drawString(&surface, text, x, y, width, 0); + + if (textCast->borderSize != kSizeNone) { + uint16 size = textCast->borderSize; + + //Indent from borders, measured in d4 + x -= 1; + y -= 4; + + height += 4; + width += 1; + + while (size) { + surface.frameRect(Common::Rect(x, y, x + height, y + width), 0); + x--; + y--; + height += 2; + width += 2; + size--; + } + } + + if (textCast->gutterSize != kSizeNone) { + x -= 1; + y -= 4; + + height += 4; + width += 1; + uint16 size = textCast->gutterSize; + + surface.frameRect(Common::Rect(x, y, x + height, y + width), 0); + + while (size) { + surface.drawLine(x + width, y, x + width, y + height, 0); + surface.drawLine(x, y + height, x + width, y + height, 0); + x++; + y++; + size--; + } + } } void Frame::drawBackgndTransSprite(Graphics::ManagedSurface &target, const Graphics::Surface &sprite, Common::Rect &drawRect) { |