From a91b96f790ed8709984a3102598b161d021025fc Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 28 Jul 2013 18:25:18 -0400 Subject: TSAGE: Corrected display of R2R conversation dialog border --- engines/tsage/converse.cpp | 2 +- engines/tsage/graphics.cpp | 69 ++++++++++++++++++++++++++++++---------------- 2 files changed, 47 insertions(+), 24 deletions(-) (limited to 'engines/tsage') diff --git a/engines/tsage/converse.cpp b/engines/tsage/converse.cpp index 46fb50b9ee..145f04a1d7 100644 --- a/engines/tsage/converse.cpp +++ b/engines/tsage/converse.cpp @@ -556,7 +556,7 @@ int ConversationChoiceDialog::textMaxWidth() const { } int ConversationChoiceDialog::numberLeft() const { - return (g_vm->getGameID() == GType_Ringworld2) ? 6 : 13; + return (g_vm->getGameID() == GType_Ringworld2) ? 8 : 13; } /*--------------------------------------------------------------------------*/ diff --git a/engines/tsage/graphics.cpp b/engines/tsage/graphics.cpp index a010b46ea5..ce19502524 100644 --- a/engines/tsage/graphics.cpp +++ b/engines/tsage/graphics.cpp @@ -798,35 +798,58 @@ void GfxElement::drawFrame() { lineP++; } } + + // Draw the edge frame + // Outer frame border + surface.hLine(tempRect.left + 2, tempRect.top, tempRect.right - 2, 0); + surface.hLine(tempRect.left + 2, tempRect.bottom, tempRect.right - 2, 0); + surface.vLine(tempRect.left, tempRect.top + 2, tempRect.bottom - 2, 0); + surface.vLine(tempRect.right, tempRect.top + 2, tempRect.bottom - 2, 0); + *((byte *)surface.getBasePtr(tempRect.left + 1, tempRect.top + 1)) = 0; + *((byte *)surface.getBasePtr(tempRect.right - 1, tempRect.top + 1)) = 0; + *((byte *)surface.getBasePtr(tempRect.left + 1, tempRect.bottom - 1)) = 0; + *((byte *)surface.getBasePtr(tempRect.right - 1, tempRect.bottom - 1)) = 0; + + // Inner frame border + surface.hLine(tempRect.left + 2, tempRect.top + 1, tempRect.right - 2, R2_GLOBALS._frameEdgeColour); + surface.hLine(tempRect.left + 2, tempRect.bottom - 1, tempRect.right - 2, R2_GLOBALS._frameEdgeColour); + surface.vLine(tempRect.left + 1, tempRect.top + 2, tempRect.bottom - 2, R2_GLOBALS._frameEdgeColour); + surface.vLine(tempRect.right - 1, tempRect.top + 2, tempRect.bottom - 2, R2_GLOBALS._frameEdgeColour); + *((byte *)surface.getBasePtr(tempRect.left + 2, tempRect.top + 2)) = R2_GLOBALS._frameEdgeColour; + *((byte *)surface.getBasePtr(tempRect.right - 2, tempRect.top + 2)) = R2_GLOBALS._frameEdgeColour; + *((byte *)surface.getBasePtr(tempRect.left + 2, tempRect.bottom - 2)) = R2_GLOBALS._frameEdgeColour; + *((byte *)surface.getBasePtr(tempRect.right - 2, tempRect.bottom - 2)) = R2_GLOBALS._frameEdgeColour; + gfxManager.unlockSurface(); + gfxManager.getSurface().addDirtyRect(tempRect); } else { // Fill dialog content with specified background colour gfxManager.fillRect(tempRect, _colors.background); - } - --tempRect.bottom; --tempRect.right; - gfxManager.fillArea(tempRect.left, tempRect.top, bgColor); - gfxManager.fillArea(tempRect.left, tempRect.bottom, fgColor); - gfxManager.fillArea(tempRect.right, tempRect.top, fgColor); - gfxManager.fillArea(tempRect.right, tempRect.bottom, fgColor); - - tempRect.collapse(-1, -1); - gfxManager.fillRect2(tempRect.left + 1, tempRect.top, tempRect.width() - 1, 1, bgColor); - gfxManager.fillRect2(tempRect.left, tempRect.top + 1, 1, tempRect.height() - 1, bgColor); - gfxManager.fillRect2(tempRect.left + 1, tempRect.bottom, tempRect.width() - 1, 1, fgColor); - gfxManager.fillRect2(tempRect.right, tempRect.top + 1, 1, tempRect.height() - 1, fgColor); - - gfxManager.fillArea(tempRect.left, tempRect.top, 0); - gfxManager.fillArea(tempRect.left, tempRect.bottom, 0); - gfxManager.fillArea(tempRect.right, tempRect.top, 0); - gfxManager.fillArea(tempRect.right, tempRect.bottom, 0); - - tempRect.collapse(-1, -1); - gfxManager.fillRect2(tempRect.left + 2, tempRect.top, tempRect.width() - 3, 1, 0); - gfxManager.fillRect2(tempRect.left, tempRect.top + 2, 1, tempRect.height() - 3, 0); - gfxManager.fillRect2(tempRect.left + 2, tempRect.bottom, tempRect.width() - 3, 1, 0); - gfxManager.fillRect2(tempRect.right, tempRect.top + 2, 1, tempRect.height() - 3, 0); + --tempRect.bottom; --tempRect.right; + gfxManager.fillArea(tempRect.left, tempRect.top, bgColor); + gfxManager.fillArea(tempRect.left, tempRect.bottom, fgColor); + gfxManager.fillArea(tempRect.right, tempRect.top, fgColor); + gfxManager.fillArea(tempRect.right, tempRect.bottom, fgColor); + + tempRect.collapse(-1, -1); + gfxManager.fillRect2(tempRect.left + 1, tempRect.top, tempRect.width() - 1, 1, bgColor); + gfxManager.fillRect2(tempRect.left, tempRect.top + 1, 1, tempRect.height() - 1, bgColor); + gfxManager.fillRect2(tempRect.left + 1, tempRect.bottom, tempRect.width() - 1, 1, fgColor); + gfxManager.fillRect2(tempRect.right, tempRect.top + 1, 1, tempRect.height() - 1, fgColor); + + gfxManager.fillArea(tempRect.left, tempRect.top, 0); + gfxManager.fillArea(tempRect.left, tempRect.bottom, 0); + gfxManager.fillArea(tempRect.right, tempRect.top, 0); + gfxManager.fillArea(tempRect.right, tempRect.bottom, 0); + + tempRect.collapse(-1, -1); + gfxManager.fillRect2(tempRect.left + 2, tempRect.top, tempRect.width() - 3, 1, 0); + gfxManager.fillRect2(tempRect.left, tempRect.top + 2, 1, tempRect.height() - 3, 0); + gfxManager.fillRect2(tempRect.left + 2, tempRect.bottom, tempRect.width() - 3, 1, 0); + gfxManager.fillRect2(tempRect.right, tempRect.top + 2, 1, tempRect.height() - 3, 0); + } gfxManager.unlockSurface(); } -- cgit v1.2.3