diff options
author | Johannes Schickel | 2009-09-20 23:00:08 +0000 |
---|---|---|
committer | Johannes Schickel | 2009-09-20 23:00:08 +0000 |
commit | e062a56c315d2a93a7496676741c767fd99b5e69 (patch) | |
tree | ee75cdcc456bfb7e337100404727b7f764929ce3 /engines/cine/gfx.cpp | |
parent | 6b9299e863c08a09875de75dfd3bcc49e56fc9d1 (diff) | |
download | scummvm-rg350-e062a56c315d2a93a7496676741c767fd99b5e69.tar.gz scummvm-rg350-e062a56c315d2a93a7496676741c767fd99b5e69.tar.bz2 scummvm-rg350-e062a56c315d2a93a7496676741c767fd99b5e69.zip |
Implement support for transparent dialgue boxes in the Amiga version of Future Wars.
svn-id: r44222
Diffstat (limited to 'engines/cine/gfx.cpp')
-rw-r--r-- | engines/cine/gfx.cpp | 33 |
1 files changed, 27 insertions, 6 deletions
diff --git a/engines/cine/gfx.cpp b/engines/cine/gfx.cpp index f17c8dd6e1..d6aa32cc3b 100644 --- a/engines/cine/gfx.cpp +++ b/engines/cine/gfx.cpp @@ -286,7 +286,7 @@ void FWRenderer::drawMessage(const char *str, int x, int y, int width, int color ty += 9; if (color >= 0) { drawPlainBox(x, ty, width, 4, color); - drawDoubleBorder(x, y, width, ty - y + 4, 2); + drawDoubleBorder(x, y, width, ty - y + 4, g_cine->getPlatform() == Common::kPlatformAmiga ? 1 : 2); } } @@ -331,9 +331,30 @@ void FWRenderer::drawPlainBox(int x, int y, int width, int height, byte color) { boxRect.clip(screenRect); // Draw the filled rectangle - byte *dest = _backBuffer + boxRect.top * 320 + boxRect.left; - for (int i = 0; i < boxRect.height(); i++) { - memset(dest + i * 320, color, boxRect.width()); + // + // Since the Amiga version uses a transparent boxes we need to decide whether: + // - we draw a box, that should be the case then both width and height is greater than 1 + // - we draw a line, that should be the case then either width or height is 1 + // When we draw a box and we're running an Amiga version we do use the special code to make + // the boxes transparent. + // When on the other hand we are drawing a line or are not running an Amiga version, we will + // always use the code, which simply fills the rect. + // + // TODO: Think over whether this is the nicest / best solution we can find for handling + // the transparency for Amiga boxes. + if (g_cine->getPlatform() == Common::kPlatformAmiga && width > 1 && height > 1) { + byte *dest = _backBuffer + boxRect.top * 320 + boxRect.left; + const int lineAdd = 320 - boxRect.width(); + for (int i = 0; i < boxRect.height(); ++i) { + for (int j = 0; j < boxRect.width(); ++j) + *dest++ += 16; + dest += lineAdd; + } + } else { + byte *dest = _backBuffer + boxRect.top * 320 + boxRect.left; + for (int i = 0; i < boxRect.height(); i++) { + memset(dest + i * 320, color, boxRect.width()); + } } } @@ -783,7 +804,7 @@ void FWRenderer::drawMenu(const CommandeType *items, unsigned int height, int x, } drawPlainBox(x, ty, width, 4, _messageBg); - drawDoubleBorder(x, y, width, ty - y + 4, 2); + drawDoubleBorder(x, y, width, ty - y + 4, g_cine->getPlatform() == Common::kPlatformAmiga ? 1 : 2); } /*! \brief Draw text input box @@ -856,7 +877,7 @@ void FWRenderer::drawInputBox(const char *info, const char *input, int cursor, i ty += 9; drawPlainBox(x, ty, width, 4, _messageBg); - drawDoubleBorder(x, y, width, ty - y + 4, 2); + drawDoubleBorder(x, y, width, ty - y + 4, g_cine->getPlatform() == Common::kPlatformAmiga ? 1 : 2); } /*! \brief Fade to black |