diff options
Diffstat (limited to 'engines/queen')
-rw-r--r-- | engines/queen/display.cpp | 4 | ||||
-rw-r--r-- | engines/queen/display.h | 6 | ||||
-rw-r--r-- | engines/queen/talk.cpp | 11 |
3 files changed, 21 insertions, 0 deletions
diff --git a/engines/queen/display.cpp b/engines/queen/display.cpp index 237c42e86e..5f57922817 100644 --- a/engines/queen/display.cpp +++ b/engines/queen/display.cpp @@ -851,6 +851,10 @@ void Display::clearTexts(uint16 y1, uint16 y2) { } } +void Display::setFocusRect(const Common::Rect& rect) { + _system->setFocusRectangle(rect); +} + int Display::textCenterX(const char *text) const { return (GAME_SCREEN_WIDTH - textWidth(text)) / 2; } diff --git a/engines/queen/display.h b/engines/queen/display.h index 6b8ea26011..8f81f11791 100644 --- a/engines/queen/display.h +++ b/engines/queen/display.h @@ -28,6 +28,9 @@ #include "queen/defs.h" class OSystem; +namespace Common { + struct Rect; +} namespace Queen { @@ -148,6 +151,9 @@ public: //! change the text color for the specified texts list entry void textColor(uint16 y, uint8 color) { _texts[y].color = color; } + + //! Set the focus rectangle to the speaking character + void setFocusRect(const Common::Rect& rect); int textCenterX(const char *text) const; uint16 textWidth(const char *text) const; diff --git a/engines/queen/talk.cpp b/engines/queen/talk.cpp index 223bd320f5..2b8d3c9508 100644 --- a/engines/queen/talk.cpp +++ b/engines/queen/talk.cpp @@ -21,6 +21,7 @@ */ #include "common/stdafx.h" +#include "common/rect.h" #include "queen/talk.h" #include "queen/bankman.h" @@ -865,6 +866,16 @@ void Talk::speakSegment( textY = bob->y; } + // Set the focus rectangle + // FIXME: This may not be correct! + BobFrame *pbf = _vm->bankMan()->fetchFrame(bob->frameNum); + + int height = (pbf->height * bob->scale) / 100; + + Common::Rect focus(textX - 96, textY - height - 64, textX + 96, textY + height + 64); + _vm->display()->setFocusRect(focus); + + //int SF = _vm->grid()->findScale(textX, textY); const SpeechParameters *parameters = NULL; |