diff options
author | Jaromir Wysoglad | 2019-06-24 09:30:41 +0200 |
---|---|---|
committer | Thierry Crozat | 2019-07-28 15:09:14 +0100 |
commit | b1f37566ea02a3e55fbe7d79e4d39d3655ca16de (patch) | |
tree | d84d7b6ff442f184874caf0e115bd73b534c9bd7 /engines/supernova | |
parent | 2f84e6d22aecc96e66477a1e14adba4755cadc63 (diff) | |
download | scummvm-rg350-b1f37566ea02a3e55fbe7d79e4d39d3655ca16de.tar.gz scummvm-rg350-b1f37566ea02a3e55fbe7d79e4d39d3655ca16de.tar.bz2 scummvm-rg350-b1f37566ea02a3e55fbe7d79e4d39d3655ca16de.zip |
SUPERNOVA: Refactor game-manager
Diffstat (limited to 'engines/supernova')
-rw-r--r-- | engines/supernova/game-manager.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/engines/supernova/game-manager.cpp b/engines/supernova/game-manager.cpp index 6aae050bb8..cefc41d02d 100644 --- a/engines/supernova/game-manager.cpp +++ b/engines/supernova/game-manager.cpp @@ -770,22 +770,21 @@ void GameManager::edit(Common::String &input, int x, int y, uint length) { uint cursorIndex = input.size(); // NOTE: Pixels for char needed = kFontWidth + 2px left and right side bearing int overdrawWidth; + Color background = kColorBlack; - if (_vm->_MSPart == 1) + if (_vm->_MSPart == 1) { overdrawWidth = ((int)((length + 1) * (kFontWidth + 2)) > (kScreenWidth - x)) ? kScreenWidth - x : (length + 1) * (kFontWidth + 2); - else if (_vm->_MSPart == 2) + background = kColorDarkBlue; + } else if (_vm->_MSPart == 2) { overdrawWidth = ((int)((length + 1) * (kFontWidth2 + 2)) > (kScreenWidth - x)) ? kScreenWidth - x : (length + 1) * (kFontWidth2 + 2); + background = kColorWhite35; + } _guiEnabled = false; while (isEditing) { _vm->_screen->setTextCursorPos(x, y); _vm->_screen->setTextCursorColor(kColorWhite99); - Color background = kColorBlack; - if (_vm->_MSPart == 1) - background = kColorDarkBlue; - else if (_vm->_MSPart == 2) - background = kColorWhite35; _vm->renderBox(x, y - 1, overdrawWidth, 9, background); for (uint i = 0; i < input.size(); ++i) { // Draw char highlight depending on cursor position |