From 88ec480cef8d637c2fd69b8197ab3c7de39ede8b Mon Sep 17 00:00:00 2001 From: Kari Salminen Date: Mon, 11 Aug 2008 23:01:32 +0000 Subject: Implemented drawMessage changes for Operation Stealth's timed cutscenes (Negative colors are used for timed text boxes that are totally transparent, only the text is drawn). svn-id: r33790 --- engines/cine/gfx.cpp | 20 ++++++++++++++------ engines/cine/gfx.h | 2 +- 2 files changed, 15 insertions(+), 7 deletions(-) (limited to 'engines') diff --git a/engines/cine/gfx.cpp b/engines/cine/gfx.cpp index 5d66be5e27..bb11cea5dc 100644 --- a/engines/cine/gfx.cpp +++ b/engines/cine/gfx.cpp @@ -225,14 +225,18 @@ void FWRenderer::drawCommand() { * \param x Top left message box corner coordinate * \param y Top left message box corner coordinate * \param width Message box width - * \param color Message box background color + * \param color Message box background color (Or if negative draws only the text) + * \note Negative colors are used in Operation Stealth's timed cutscenes + * (e.g. when first meeting The Movement for the Liberation of Santa Paragua). */ -void FWRenderer::drawMessage(const char *str, int x, int y, int width, byte color) { +void FWRenderer::drawMessage(const char *str, int x, int y, int width, int color) { int i, tx, ty, tw; int line = 0, words = 0, cw = 0; int space = 0, extraSpace = 0; - drawPlainBox(x, y, width, 4, color); + if (color >= 0) { + drawPlainBox(x, y, width, 4, color); + } tx = x + 4; ty = str[0] ? y - 5 : y + 4; tw = width - 8; @@ -252,7 +256,9 @@ void FWRenderer::drawMessage(const char *str, int x, int y, int width, byte colo } ty += 9; - drawPlainBox(x, ty, width, 9, color); + if (color >= 0) { + drawPlainBox(x, ty, width, 9, color); + } tx = x + 4; } @@ -269,8 +275,10 @@ void FWRenderer::drawMessage(const char *str, int x, int y, int width, byte colo } ty += 9; - drawPlainBox(x, ty, width, 4, color); - drawDoubleBorder(x, y, width, ty - y + 4, 2); + if (color >= 0) { + drawPlainBox(x, ty, width, 4, color); + drawDoubleBorder(x, y, width, ty - y + 4, 2); + } } /*! \brief Draw rectangle on screen diff --git a/engines/cine/gfx.h b/engines/cine/gfx.h index 078954e3b9..22545abf0b 100644 --- a/engines/cine/gfx.h +++ b/engines/cine/gfx.h @@ -68,7 +68,7 @@ protected: virtual void drawSprite(const objectStruct &obj); void drawCommand(); - void drawMessage(const char *str, int x, int y, int width, byte color); + void drawMessage(const char *str, int x, int y, int width, int color); void drawPlainBox(int x, int y, int width, int height, byte color); void drawBorder(int x, int y, int width, int height, byte color); void drawDoubleBorder(int x, int y, int width, int height, byte color); -- cgit v1.2.3