diff options
-rw-r--r-- | engines/agi/menu.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/engines/agi/menu.cpp b/engines/agi/menu.cpp index 803efd757e..cef60ca161 100644 --- a/engines/agi/menu.cpp +++ b/engines/agi/menu.cpp @@ -64,6 +64,8 @@ GfxMenu::~GfxMenu() { } void GfxMenu::addMenu(const char *menuText) { + int16 curColumnEnd = _setupMenuColumn; + // already submitted? in that case no further changes possible if (_submitted) return; @@ -72,6 +74,18 @@ void GfxMenu::addMenu(const char *menuText) { menuEntry->text = menuText; menuEntry->textLen = menuEntry->text.size(); + + // Cut menu name in case menu bar is full + // Happens in at least the fan game Get Outta Space Quest + // Original interpreter had graphical issues in this case + // TODO: this whole code needs to get reworked anyway to support different types of menu bars depending on platform + curColumnEnd += menuEntry->textLen; + while ((menuEntry->textLen) && (curColumnEnd > 40)) { + menuEntry->text.deleteLastChar(); + menuEntry->textLen--; + curColumnEnd--; + } + menuEntry->row = 0; menuEntry->column = _setupMenuColumn; menuEntry->itemCount = 0; @@ -365,6 +379,10 @@ void GfxMenu::drawMenuName(int16 menuNr, bool inverted) { GuiMenuEntry *menuEntry = _array[menuNr]; bool disabledLook = false; + // Don't draw in case there is no text + if (!menuEntry->text.size()) + return; + if (!inverted) { _text->charAttrib_Set(0, _text->calculateTextBackground(15)); } else { |