From 78bacb47bb1fb21f86cc3b16795c5a846e49f4e8 Mon Sep 17 00:00:00 2001 From: Pawel Kolodziejski Date: Sat, 7 Apr 2012 17:58:15 +0200 Subject: [PATCH] ALL: synced with scummvm --- TODO | 2 +- backends/modular-backend.h | 2 - base/main.cpp | 4 +- common/gui_options.cpp | 1 - common/gui_options.h | 1 - engines/advancedDetector.cpp | 13 +- graphics/surface.cpp | 4 +- gui/ThemeEngine.h | 2 +- gui/launcher.cpp | 3 +- gui/predictivedialog.cpp | 189 +++++++++++---------- gui/predictivedialog.h | 36 ++-- gui/themes/default.inc | 6 - gui/themes/modern.zip | Bin 1450416 -> 1450379 bytes gui/themes/modern/THEMERC | 2 +- gui/themes/modern/cursor.bmp | Bin 3126 -> 3126 bytes gui/themes/modern/cursor_small.bmp | Bin 1062 -> 1062 bytes gui/themes/modern/modern_gfx.stx | 10 +- gui/themes/modern/modern_layout.stx | 3 - gui/themes/modern/modern_layout_lowres.stx | 3 - 19 files changed, 145 insertions(+), 136 deletions(-) diff --git a/TODO b/TODO index de377497af4..51d48170128 100644 --- a/TODO +++ b/TODO @@ -1,3 +1,3 @@ You may find it at the following link: - http://wiki.residualvm.org/index.php?title=TODO + http://wiki.residualvm.org/index.php/TODO diff --git a/backends/modular-backend.h b/backends/modular-backend.h index 2aa222f51aa..f60bbb2b2eb 100644 --- a/backends/modular-backend.h +++ b/backends/modular-backend.h @@ -72,7 +72,6 @@ public: virtual Common::List getSupportedFormats() const; #endif virtual void initSize(uint width, uint height, const Graphics::PixelFormat *format = NULL); - // ResidualVM specific method virtual void launcherInitSize(uint w, uint h); // ResidualVM specific method @@ -107,7 +106,6 @@ public: virtual void warpMouse(int x, int y); virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int cursorTargetScale = 1, const Graphics::PixelFormat *format = NULL); virtual void setCursorPalette(const byte *colors, uint start, uint num); - // ResidualVM specific method virtual bool lockMouse(bool lock); diff --git a/base/main.cpp b/base/main.cpp index 3939d55def8..ebce9ca83d4 100644 --- a/base/main.cpp +++ b/base/main.cpp @@ -206,8 +206,8 @@ static Common::Error runGame(const EnginePlugin *plugin, OSystem &system, const // Initialize any game-specific keymaps engine->initKeymap(); - // Set default values to the custom engine options - const ExtraGuiOptions engineOptions = (*plugin)->getExtraGuiOptions(ConfMan.getActiveDomainName()); + // Set default values for all of the custom engine options + const ExtraGuiOptions engineOptions = (*plugin)->getExtraGuiOptions(Common::String()); for (uint i = 0; i < engineOptions.size(); i++) { ConfMan.registerDefault(engineOptions[i].configOption, engineOptions[i].defaultState); } diff --git a/common/gui_options.cpp b/common/gui_options.cpp index 59fbfb38d12..e463232276d 100644 --- a/common/gui_options.cpp +++ b/common/gui_options.cpp @@ -52,7 +52,6 @@ const struct GameOpt { { GUIO_MIDIGM, "midiGM" }, { GUIO_NOASPECT, "noAspect" }, - { GUIO_EGAUNDITHER, "egaUndither" }, { GUIO_RENDERHERCGREEN, "hercGreen" }, { GUIO_RENDERHERCAMBER, "hercAmber" }, diff --git a/common/gui_options.h b/common/gui_options.h index 774e57e1338..9da19b1c3e1 100644 --- a/common/gui_options.h +++ b/common/gui_options.h @@ -44,7 +44,6 @@ #define GUIO_MIDIGM "\021" #define GUIO_NOASPECT "\022" -#define GUIO_EGAUNDITHER "\023" #define GUIO_RENDERHERCGREEN "\030" #define GUIO_RENDERHERCAMBER "\031" diff --git a/engines/advancedDetector.cpp b/engines/advancedDetector.cpp index 27b93f73959..d61c4db80aa 100644 --- a/engines/advancedDetector.cpp +++ b/engines/advancedDetector.cpp @@ -171,12 +171,21 @@ const ExtraGuiOptions AdvancedMetaEngine::getExtraGuiOptions(const Common::Strin if (!_extraGuiOptions) return ExtraGuiOptions(); + ExtraGuiOptions options; + + // If there isn't any target specified, return all available GUI options. + // Only used when an engine starts in order to set option defaults. + if (target.empty()) { + for (const ADExtraGuiOptionsMap *entry = _extraGuiOptions; entry->guioFlag; ++entry) + options.push_back(entry->option); + + return options; + } + // Query the GUI options const Common::String guiOptionsString = ConfMan.get("guioptions", target); const Common::String guiOptions = parseGameGUIOptions(guiOptionsString); - ExtraGuiOptions options; - // Add all the applying extra GUI options. for (const ADExtraGuiOptionsMap *entry = _extraGuiOptions; entry->guioFlag; ++entry) { if (guiOptions.contains(entry->guioFlag)) diff --git a/graphics/surface.cpp b/graphics/surface.cpp index fcd702241ab..c0f1046eae6 100644 --- a/graphics/surface.cpp +++ b/graphics/surface.cpp @@ -295,7 +295,7 @@ Graphics::Surface *Surface::convertTo(const PixelFormat &dstFormat, const byte * assert(palette); for (int y = 0; y < h; y++) { - const byte *srcRow = (byte *)getBasePtr(0, y); + const byte *srcRow = (const byte *)getBasePtr(0, y); byte *dstRow = (byte *)surface->getBasePtr(0, y); for (int x = 0; x < w; x++) { @@ -317,7 +317,7 @@ Graphics::Surface *Surface::convertTo(const PixelFormat &dstFormat, const byte * } else { // Converting from high color to high color for (int y = 0; y < h; y++) { - const byte *srcRow = (byte *)getBasePtr(0, y); + const byte *srcRow = (const byte *)getBasePtr(0, y); byte *dstRow = (byte *)surface->getBasePtr(0, y); for (int x = 0; x < w; x++) { diff --git a/gui/ThemeEngine.h b/gui/ThemeEngine.h index e26a584354c..0495a85c88c 100644 --- a/gui/ThemeEngine.h +++ b/gui/ThemeEngine.h @@ -35,7 +35,7 @@ #include "graphics/pixelformat.h" -#define SCUMMVM_THEME_VERSION_STR "SCUMMVM_STX0.8.10" +#define SCUMMVM_THEME_VERSION_STR "SCUMMVM_STX0.8.11" class OSystem; diff --git a/gui/launcher.cpp b/gui/launcher.cpp index c53511da4fd..7bbfeccbd89 100644 --- a/gui/launcher.cpp +++ b/gui/launcher.cpp @@ -367,8 +367,7 @@ void EditGameDialog::open() { e = ConfMan.hasKey("gfx_mode", _domain) || ConfMan.hasKey("render_mode", _domain) || ConfMan.hasKey("fullscreen", _domain) || - ConfMan.hasKey("aspect_ratio", _domain) || - ConfMan.hasKey("disable_dithering", _domain); + ConfMan.hasKey("aspect_ratio", _domain); _globalGraphicsOverride->setState(e); e = ConfMan.hasKey("music_driver", _domain) || diff --git a/gui/predictivedialog.cpp b/gui/predictivedialog.cpp index ac329867d29..9cd18b81ba3 100644 --- a/gui/predictivedialog.cpp +++ b/gui/predictivedialog.cpp @@ -34,7 +34,9 @@ #include "common/file.h" #include "common/savefile.h" -using namespace Common; +#ifdef __DS__ +#include "backends/platform/ds/arm9/source/wordcompletion.h" +#endif namespace GUI { @@ -67,21 +69,21 @@ enum { PredictiveDialog::PredictiveDialog() : Dialog("Predictive") { new StaticTextWidget(this, "Predictive.Headline", "Enter Text"); - new ButtonWidget(this, "Predictive.Cancel" , _("Cancel") , 0, kCancelCmd); - new ButtonWidget(this, "Predictive.OK" , _("Ok") , 0, kOkCmd); - new ButtonWidget(this, "Predictive.Button1", "1 `-.&" , 0, kBut1Cmd); - new ButtonWidget(this, "Predictive.Button2", "2 abc" , 0, kBut2Cmd); - new ButtonWidget(this, "Predictive.Button3", "3 def" , 0, kBut3Cmd); - new ButtonWidget(this, "Predictive.Button4", "4 ghi" , 0, kBut4Cmd); - new ButtonWidget(this, "Predictive.Button5", "5 jkl" , 0, kBut5Cmd); - new ButtonWidget(this, "Predictive.Button6", "6 mno" , 0, kBut6Cmd); - new ButtonWidget(this, "Predictive.Button7", "7 pqrs" , 0, kBut7Cmd); - new ButtonWidget(this, "Predictive.Button8", "8 tuv" , 0, kBut8Cmd); - new ButtonWidget(this, "Predictive.Button9", "9 wxyz" , 0, kBut9Cmd); + new ButtonWidget(this, "Predictive.Cancel" , _("Cancel"), 0, kCancelCmd); + new ButtonWidget(this, "Predictive.OK" , _("Ok") , 0, kOkCmd); + new ButtonWidget(this, "Predictive.Button1", "1 `-.&" , 0, kBut1Cmd); + new ButtonWidget(this, "Predictive.Button2", "2 abc" , 0, kBut2Cmd); + new ButtonWidget(this, "Predictive.Button3", "3 def" , 0, kBut3Cmd); + new ButtonWidget(this, "Predictive.Button4", "4 ghi" , 0, kBut4Cmd); + new ButtonWidget(this, "Predictive.Button5", "5 jkl" , 0, kBut5Cmd); + new ButtonWidget(this, "Predictive.Button6", "6 mno" , 0, kBut6Cmd); + new ButtonWidget(this, "Predictive.Button7", "7 pqrs" , 0, kBut7Cmd); + new ButtonWidget(this, "Predictive.Button8", "8 tuv" , 0, kBut8Cmd); + new ButtonWidget(this, "Predictive.Button9", "9 wxyz" , 0, kBut9Cmd); new ButtonWidget(this, "Predictive.Button0", "0" , 0, kBut0Cmd); // I18N: You must leave "#" as is, only word 'next' is translatable - new ButtonWidget(this, "Predictive.Next" , _("# next") , 0, kNextCmd); - _addBtn = new ButtonWidget(this, "Predictive.Add", _("add") , 0, kAddCmd); + new ButtonWidget(this, "Predictive.Next" , _("# next"), 0, kNextCmd); + _addBtn = new ButtonWidget(this, "Predictive.Add", _("add"), 0, kAddCmd); _addBtn->setEnabled(false); #ifndef DISABLE_FANCY_THEMES @@ -89,7 +91,7 @@ PredictiveDialog::PredictiveDialog() : Dialog("Predictive") { ((PicButtonWidget *)_delbtn)->useThemeTransparency(true); ((PicButtonWidget *)_delbtn)->setGfx(g_gui.theme()->getImageSurface(ThemeEngine::kImageDelbtn)); #endif - _delbtn = new ButtonWidget(this, "Predictive.Delete" , _("<") , 0, kDelCmd); + _delbtn = new ButtonWidget(this, "Predictive.Delete" , _("<"), 0, kDelCmd); // I18N: Pre means 'Predictive', leave '*' as is _modebutton = new ButtonWidget(this, "Predictive.Pre", _("* Pre"), 0, kModeCmd); _edittext = new EditTextWidget(this, "Predictive.Word", _search, 0, 0, 0); @@ -110,7 +112,7 @@ PredictiveDialog::PredictiveDialog() : Dialog("Predictive") { _predictiveDict.dictLine = NULL; _predictiveDict.dictText = NULL; _predictiveDict.dictLineCount = 0; - + if (!_predictiveDict.dictText) { loadAllDictionary(_predictiveDict); if (!_predictiveDict.dictText) @@ -140,7 +142,7 @@ PredictiveDialog::PredictiveDialog() : Dialog("Predictive") { _currentWord.clear(); _wordNumber = 0; _numMatchingWords = 0; - + _lastbutton = kNoAct; _mode = kModePre; @@ -306,7 +308,7 @@ void PredictiveDialog::handleKeyDown(Common::KeyState state) { } } -void PredictiveDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) { +void PredictiveDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) { ButtonId act = kNoAct; _navigationwithkeys = false; @@ -372,24 +374,30 @@ void PredictiveDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 d void PredictiveDialog::processBtnActive(ButtonId button) { uint8 x; - const char *buttonStr[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9", "0" }; - const char *buttons[] = { - "'-.&", "abc", "def", - "ghi", "jkl", "mno", - "pqrs", "tuv", "wxyz", - "next", "add", - "<", - "Cancel", "OK", - "Pre", "(0) ", NULL + static const char *const buttonStr[] = { + "1", "2", "3", + "4", "5", "6", + "7", "8", "9", + "0" + }; + + static const char *const buttons[] = { + "'-.&", "abc", "def", + "ghi", "jkl", "mno", + "pqrs", "tuv", "wxyz", + "next", "add", + "<", + "Cancel", "OK", + "Pre", "(0) ", NULL }; if (_mode == kModeAbc) { - if (button >= kBtn1Act && button <= kBtn9Act ) { + if (button >= kBtn1Act && button <= kBtn9Act) { if (!_lastTime) _lastTime = g_system->getMillis(); if (_lastPressBtn == button) { _curTime = g_system->getMillis(); - if((_curTime - _lastTime) < kRepeatDelay) { + if ((_curTime - _lastTime) < kRepeatDelay) { button = kNextAct; _lastTime = _curTime; } else { @@ -425,13 +433,13 @@ void PredictiveDialog::processBtnActive(ButtonId button) { if (_currentCode.size()) { _repeatcount[_currentCode.size() - 1] = 0; _currentCode.deleteLastChar(); - if(_currentCode == Common::String("")) + if (_currentCode.empty()) _currentWord.clear(); } else { if (_prefix.size()) _prefix.deleteLastChar(); } - } else if (_prefix.size() + _currentCode.size() < MAXWORDLEN - 1) { // don't overflow the dialog line + } else if (_prefix.size() + _currentCode.size() < kMaxWordLen - 1) { // don't overflow the dialog line if (button == kBtn0Act) { // zero _currentCode += buttonStr[9]; } else { @@ -461,26 +469,26 @@ void PredictiveDialog::processBtnActive(ButtonId button) { if (_mode == kModePre) { if (_unitedDict.dictActLine && _numMatchingWords > 1) { _wordNumber = (_wordNumber + 1) % _numMatchingWords; - char tmp[MAXLINELEN]; - strncpy(tmp, _unitedDict.dictActLine, MAXLINELEN); - tmp[MAXLINELEN - 1] = 0; + char tmp[kMaxLineLen]; + strncpy(tmp, _unitedDict.dictActLine, kMaxLineLen); + tmp[kMaxLineLen - 1] = 0; char *tok = strtok(tmp, " "); for (uint8 i = 0; i <= _wordNumber; i++) tok = strtok(NULL, " "); - _currentWord = Common::String(tok, _currentCode.size()); - } - } else if (_mode == kModeAbc) { - x = _currentCode.size(); - if (x) { - if (_currentCode.lastChar() == '1' || _currentCode.lastChar() == '7' || _currentCode.lastChar() == '9') - _repeatcount[x - 1] = (_repeatcount[x - 1] + 1) % 4; - else + _currentWord = Common::String(tok, _currentCode.size()); + } + } else if (_mode == kModeAbc) { + x = _currentCode.size(); + if (x) { + if (_currentCode.lastChar() == '1' || _currentCode.lastChar() == '7' || _currentCode.lastChar() == '9') + _repeatcount[x - 1] = (_repeatcount[x - 1] + 1) % 4; + else _repeatcount[x - 1] = (_repeatcount[x - 1] + 1) % 3; - if (_currentCode.lastChar() >= '1') - _currentWord.setChar(buttons[_currentCode[x - 1] - '1'][_repeatcount[x - 1]], x-1); - } + if (_currentCode.lastChar() >= '1') + _currentWord.setChar(buttons[_currentCode[x - 1] - '1'][_repeatcount[x - 1]], x - 1); } + } } else if (button == kAddAct) { // add if (_mode == kModeAbc) addWordToDict(); @@ -490,17 +498,21 @@ void PredictiveDialog::processBtnActive(ButtonId button) { // bring MRU word at the top of the list when ok'ed out of the dialog if (_mode == kModePre && _unitedDict.dictActLine && _numMatchingWords > 1 && _wordNumber != 0) bringWordtoTop(_unitedDict.dictActLine, _wordNumber); - - goto press; } else if (button == kModeAct) { // Mode _mode++; _addBtn->setEnabled(false); - if (_mode > kModeAbc) { - _mode = kModePre; - // I18N: Pre means 'Predictive', leave '*' as is - _modebutton->setLabel("* Pre"); - // I18N: 'Num' means Numbers, 'Abc' means Latin alphabet input - } else (_mode == kModeNum) ? _modebutton->setLabel("* Num") : (_modebutton->setLabel("* Abc"), _addBtn->setEnabled(true)); + if (_mode > kModeAbc) { + _mode = kModePre; + // I18N: Pre means 'Predictive', leave '*' as is + _modebutton->setLabel("* Pre"); + } else if (_mode == kModeNum) { + // I18N: 'Num' means Numbers + _modebutton->setLabel("* Num"); + } else { + // I18N: 'Abc' means Latin alphabet input + _modebutton->setLabel("* Abc"); + _addBtn->setEnabled(true); + } // truncate current input at mode change strncpy(_temp, _currentWord.c_str(), _currentCode.size()); @@ -509,26 +521,29 @@ void PredictiveDialog::processBtnActive(ButtonId button) { _currentCode.clear(); _currentWord.clear(); memset(_repeatcount, 0, sizeof(_repeatcount)); - + _lastTime = 0; _lastPressBtn = kNoAct; _curTime = 0; - } else { - goto press; } } -press: pressEditText(); - if (button == kOkAct) close(); + if (button == kOkAct) + close(); } void PredictiveDialog::handleTickle() { - if (!_lastTime) + // TODO/FIXME: This code does not seem to make any sense. It is only + // triggered when _lastTime is zero and sets _lastTime to zero again + // under some condition. This should really be a nop. Probably this + // code intends to check "_lastTime" instead of "!_lastTime". + if (!_lastTime) { if ((_curTime - _lastTime) > kRepeatDelay) { _lastTime = 0; } + } } void PredictiveDialog::mergeDicts() { @@ -564,9 +579,9 @@ void PredictiveDialog::mergeDicts() { } } -uint8 PredictiveDialog::countWordsInString(char *str) { - // Count the number of (space separated) words in the given string. - char *ptr; +uint8 PredictiveDialog::countWordsInString(const char *const str) { + // Count the number of (space separated) words in the given string. + const char *ptr; if (!str) return 0; @@ -591,12 +606,12 @@ void PredictiveDialog::bringWordtoTop(char *str, int wordnum) { // by moving the word at position 'wordnum' to the front (that is, right behind // right behind the numerical code word at the start of the line). Common::Array words; - char buf[MAXLINELEN]; + char buf[kMaxLineLen]; if (!str) return; - strncpy(buf, str, MAXLINELEN); - buf[MAXLINELEN - 1] = 0; + strncpy(buf, str, kMaxLineLen); + buf[kMaxLineLen - 1] = 0; char *word = strtok(buf, " "); if (!word) { debug("Predictive Dialog: Invalid dictionary line"); @@ -610,12 +625,12 @@ void PredictiveDialog::bringWordtoTop(char *str, int wordnum) { Common::String tmp; for (uint8 i = 0; i < words.size(); i++) - tmp += words[i] + " "; + tmp += words[i] + " "; tmp.deleteLastChar(); memcpy(str, tmp.c_str(), strlen(str)); } -int PredictiveDialog::binarySearch(char **dictLine, const String &code, int dictLineCount) { +int PredictiveDialog::binarySearch(const char *const *const dictLine, const Common::String &code, const int dictLineCount) { int hi = dictLineCount - 1; int lo = 0; int line = 0; @@ -644,7 +659,7 @@ bool PredictiveDialog::matchWord() { return false; // If the currently entered text is too long, it cannot match anything. - if (_currentCode.size() > MAXWORDLEN) + if (_currentCode.size() > kMaxWordLen) return false; // The entries in the dictionary consist of a code, a space, and then @@ -664,9 +679,9 @@ bool PredictiveDialog::matchWord() { _currentWord.clear(); _wordNumber = 0; if (0 == strncmp(_unitedDict.dictLine[line], _currentCode.c_str(), _currentCode.size())) { - char tmp[MAXLINELEN]; - strncpy(tmp, _unitedDict.dictLine[line], MAXLINELEN); - tmp[MAXLINELEN - 1] = 0; + char tmp[kMaxLineLen]; + strncpy(tmp, _unitedDict.dictLine[line], kMaxLineLen); + tmp[kMaxLineLen - 1] = 0; char *tok = strtok(tmp, " "); tok = strtok(NULL, " "); _currentWord = Common::String(tok, _currentCode.size()); @@ -676,13 +691,13 @@ bool PredictiveDialog::matchWord() { } } -bool PredictiveDialog::searchWord(char *where, const String &whatCode) { - char *ptr = where; +bool PredictiveDialog::searchWord(const char *const where, const Common::String &whatCode) { + const char *ptr = where; ptr += whatCode.size(); - char *newPtr; + const char *newPtr; bool is = false; - while((newPtr = strchr(ptr, ' '))) { + while ((newPtr = strchr(ptr, ' '))) { if (0 == strncmp(ptr, _currentWord.c_str(), newPtr - ptr)) { is = true; break; @@ -697,7 +712,7 @@ bool PredictiveDialog::searchWord(char *where, const String &whatCode) { return is; } -void PredictiveDialog::addWord(Dict &dict, const String &word, const String &code) { +void PredictiveDialog::addWord(Dict &dict, const Common::String &word, const Common::String &code) { char *newLine; Common::String tmpCode = code + ' '; int line = binarySearch(dict.dictLine, tmpCode, dict.dictLineCount); @@ -729,22 +744,22 @@ void PredictiveDialog::addWord(Dict &dict, const String &word, const String &cod } } else { // if we didn't find the code, we need to INSERT new line with code and word if (dict.nameDict == "user_dictionary") { - // if we must INSERT new line(code and word) to user_dictionary, we need to + // if we must INSERT new line(code and word) to user_dictionary, we need to // check if there is a line that we want to INSERT in predictive dictionay int predictLine = binarySearch(_predictiveDict.dictLine, tmpCode, _predictiveDict.dictLineCount); - if (predictLine >= 0) { + if (predictLine >= 0) { if (searchWord(_predictiveDict.dictLine[predictLine], tmpCode)) { // if code and word is in predictive dictionary, we need to copy // this line to user dictionary int len = (predictLine == _predictiveDict.dictLineCount - 1) ? &_predictiveDict.dictText[_predictiveDict.dictTextSize] - _predictiveDict.dictLine[predictLine] : - _predictiveDict.dictLine[predictLine + 1] - _predictiveDict.dictLine[predictLine]; + _predictiveDict.dictLine[predictLine + 1] - _predictiveDict.dictLine[predictLine]; newLine = (char *)malloc(len); strncpy(newLine, _predictiveDict.dictLine[predictLine], len); } else { // if there is no word in predictive dictionary, we need to copy to // user dictionary mathed line + new word. int len = (predictLine == _predictiveDict.dictLineCount - 1) ? &_predictiveDict.dictText[_predictiveDict.dictTextSize] - _predictiveDict.dictLine[predictLine] : - _predictiveDict.dictLine[predictLine + 1] - _predictiveDict.dictLine[predictLine]; + _predictiveDict.dictLine[predictLine + 1] - _predictiveDict.dictLine[predictLine]; newLine = (char *)malloc(len + word.size() + 1); char *ptr = newLine; strncpy(ptr, _predictiveDict.dictLine[predictLine], len); @@ -792,7 +807,7 @@ void PredictiveDialog::addWord(Dict &dict, const String &word, const String &cod newDictLine[k++] = dict.dictLine[i]; } } - if (!inserted) + if (!inserted) newDictLine[k] = newLine; _memoryList[_numMemory++] = newLine; @@ -817,9 +832,9 @@ void PredictiveDialog::addWord(Dict &dict, const String &word, const String &cod } void PredictiveDialog::addWordToDict() { - if (_numMemory < MAXWORD) { + if (_numMemory < kMaxWord) { addWord(_unitedDict, _currentWord, _currentCode); - addWord(_userDict, _currentWord, _currentCode); + addWord(_userDict, _currentWord, _currentCode); } else { warning("Predictive Dialog: You cannot add word to user dictionary..."); } @@ -841,7 +856,7 @@ void PredictiveDialog::loadDictionary(Common::SeekableReadStream *in, Dict &dict in->read(dict.dictText, dict.dictTextSize); dict.dictText[dict.dictTextSize] = 0; uint32 time2 = g_system->getMillis(); - debug("Predictive Dialog: Time to read %s: %d bytes, %d ms", ConfMan.get(dict.nameDict).c_str(), dict.dictTextSize, time2-time1); + debug("Predictive Dialog: Time to read %s: %d bytes, %d ms", ConfMan.get(dict.nameDict).c_str(), dict.dictTextSize, time2 - time1); delete in; char *ptr = dict.dictText; @@ -883,14 +898,14 @@ void PredictiveDialog::loadDictionary(Common::SeekableReadStream *in, Dict &dict #endif uint32 time3 = g_system->getMillis(); - debug("Predictive Dialog: Time to parse %s: %d, total: %d", ConfMan.get(dict.nameDict).c_str(), time3-time2, time3-time1); + debug("Predictive Dialog: Time to parse %s: %d, total: %d", ConfMan.get(dict.nameDict).c_str(), time3 - time2, time3 - time1); } void PredictiveDialog::loadAllDictionary(Dict &dict) { ConfMan.registerDefault(dict.nameDict, dict.fnameDict); if (dict.nameDict == "predictive_dictionary") { - Common::File *inFile = new File(); + Common::File *inFile = new Common::File(); if (!inFile->open(ConfMan.get(dict.nameDict))) { warning("Predictive Dialog: cannot read file: %s", dict.fnameDict.c_str()); return; @@ -914,4 +929,4 @@ void PredictiveDialog::pressEditText() { _edittext->draw(); } -} // namespace GUI \ No newline at end of file +} // namespace GUI diff --git a/gui/predictivedialog.h b/gui/predictivedialog.h index 6d7cd320b71..32de36d5f28 100644 --- a/gui/predictivedialog.h +++ b/gui/predictivedialog.h @@ -57,14 +57,12 @@ enum { }; enum { - MAXLINELEN = 80, - MAXWORDLEN = 24, - MAXWORD = 50 + kMaxLineLen = 80, + kMaxWordLen = 24, + kMaxWord = 50 }; class PredictiveDialog : public GUI::Dialog { - typedef Common::String String; - public: PredictiveDialog(); ~PredictiveDialog(); @@ -73,7 +71,7 @@ public: virtual void handleKeyDown(Common::KeyState state); virtual void handleTickle(); - char * getResult() { return _predictiveResult; } + const char *getResult() const { return _predictiveResult; } private: struct Dict { char **dictLine; @@ -81,18 +79,18 @@ private: char *dictActLine; // using only for united dict... int32 dictLineCount; int32 dictTextSize; - String nameDict; - String fnameDict; + Common::String nameDict; + Common::String fnameDict; }; - uint8 countWordsInString(char *str); + uint8 countWordsInString(const char *const str); void bringWordtoTop(char *str, int wordnum); void loadDictionary(Common::SeekableReadStream *in, Dict &dict); void loadAllDictionary(Dict &dict); void addWordToDict(); - void addWord(Dict &dict, const String &word, const String &code); - bool searchWord(char *where, const String &whatCode); - int binarySearch(char **dictLine, const String &code, int dictLineCount); + void addWord(Dict &dict, const Common::String &word, const Common::String &code); + bool searchWord(const char *const where, const Common::String &whatCode); + int binarySearch(const char *const *const dictLine, const Common::String &code, const int dictLineCount); bool matchWord(); void processBtnActive(ButtonId active); void pressEditText(); @@ -114,20 +112,20 @@ private: uint8 _numMatchingWords; char _predictiveResult[40]; - String _currentCode; - String _currentWord; - String _prefix; + Common::String _currentCode; + Common::String _currentWord; + Common::String _prefix; uint32 _curTime, _lastTime; ButtonId _lastPressBtn; - char _temp[MAXWORDLEN + 1]; - int _repeatcount[MAXWORDLEN]; + char _temp[kMaxWordLen + 1]; + int _repeatcount[kMaxWordLen]; - char *_memoryList[MAXWORD]; + char *_memoryList[kMaxWord]; int _numMemory; - String _search; + Common::String _search; bool _navigationwithkeys; private: diff --git a/gui/themes/default.inc b/gui/themes/default.inc index c1047c0994b..542f776dbd6 100644 --- a/gui/themes/default.inc +++ b/gui/themes/default.inc @@ -782,9 +782,6 @@ " " -" " " " " " " " @@ -1727,9 +1724,6 @@ " " -" " " " " " " " diff --git a/gui/themes/modern.zip b/gui/themes/modern.zip index 761380eddeefa30f709ff7c845a7bedc60ded59b..1aebf5b2c50ebaea540c6d8cbae1d7c321a44216 100644 GIT binary patch delta 2138 zcmbVNZ){Ul6u+g%2V+2#DLdu@L_x zg0akO*0Du)CXPQs6phCCC(HYyM$?$>!(2j^eZVaK`DB`vX2O3{~M+uKqR?{sf64?aJCWLIll1*5% z32`zZx##VUL%D`~Ul|#P=6R_d{<$i-;rQ!P6i&@aad>M^@=58Zo|~BX1Uy4xNK<&6 z!za%9d>xx(siXa`Y3d+X*T(88{hrdfosEwgYL`2Aa>8csC*%*8>tw-Ca2+8x$c@|^ zXQLbUHMjKKA8#adj?md?O}ie4+c7W|R4U{J;UhwR$9*!jU$V>UxaG!pQhVQOB0Qph*as3vl zks)!II%j5nF_w1jHW~jOIdV+2yYY#OTQyTt0Qab;#m?dG~U8;0B4m4 zJW$312I4trA>uVWnbIdZL`->ybp<>R%9G(oGw}Q%g(K+xO92Maz;h?J!W%GSW5#bn zVyS-vW^9Zk3nA)acS7NL77G=tTamRSVjUrtv{p@(2GK-mb{qQQ zooQRv3U*5f!=-(CDSvTly^RfO@TaFgU+f@cQC)vto{B)vHF*vEd`0#`&y*~}r_*v2 zI)0P=uz6OlfP21?KZN0LYACEo`TRko|jcXDQr{pJKz&jgu5i^DE|7khC@>x9Ru zSW=j3hKp6K!TE2SjXd1j+4)3wS2z3}WC5^-*gEi`V9WS8WdeSeQA(riO}5 z6+65BqXcIVX@Scj)?o1tI$(Ct5kN)_O~b}8+aU~%!=W&X3)kL-_rh!&T?;>k*+bL= z;Rp++wZW{l)VPxnO&r`SJ~g-AQJFm3-`m&STf6^-p4KKR_y`~Rrt)D4aiZuyo=)Z* sj7HdYIsiXJSc1wRDtMk2JA)BB^TW0fb3&KGLev5|g;hz<1R1jb0~asdT>t<8 delta 4741 zcmc&&ZD<@t7@plrHkXekCgvteypLcHj6xa(b7>kcjXeq_B`vW{&kE99n&yKhy<9G} zDYdJCODckBD2~B!MSs{@3bvJYK~X9}1S$1LET!m=RQf}qKl(#Mke2%HPIt0jw|BQW z@R)abcXprWdFPqAU3T7Ij9y%f*6i+b71bghA@pZ#YU}*LFXuk0*~m4&8%l+^REST7 zT&Yk|DpY(WBvjpW|9$Aa@H=P7AEf)H&?7$J9yw?TIRF8~gp>872j5t@@R>cK2{@ge zukC$))4naq>0>rf6RxSPnfvioZfSeRj!wX39KRkovv9g(@&$CSyK<(*zE%ZyDt)@K zZ*zA%`f_J0`gJ?H5ovs_#j?sZeFX?saMCN>VkduoGpIq{8++Xn$T~GRbbl9ZfZNy< z962_|?lLD7Cn|yrNE6q1@Z&E&HA85Rl_21XzYgy^@@6Iw^jqNs@p4Dc(S9406|m@P z$DU-&9%RCSC;P_^7(t@d^4C-fQWhvHkVepbyeXIZF%G}`r)=NzAk}KT|&C^yO4Z}9Oy5rt{F^3h9~-BhX*3V$)SP7 z@YtYqr@5?wBXMs@Bl&(sD4#vKB0!WtxTTXTrN0F>6aig&?EI~}KzCO=!o$g}%@eR+wsg4cRoTwWS|D_&ex3`b~Gsem#-2;^wwS!j?@A?Q>k*5^ME z(dyX~*d&l;PP6z=%a=!>z8mrtPzP#Jhg`j=n9tb3B{~Z>Fq=!jXlQcjV1CBx^YNcj z10!v8#mE9GJDp>=&89@dC7u6()J`W;Vgk^!PJ6WcGOfsJSCYaDSn+GdkdOahoxvey z3`>}28V!r3$7Vt2e=Y)Ar5rVwm<7MVf5r}pv$@FX5S38L#XQz39Y-z#DtmTvqyH8b z=~s|rW7sU{24MC-_u3hwA<+rwt2dG7x&EnACIJ(>-O8s_7XHHpO92P$24mRi8b9;D zfb8Z0WF~jyzd;}~yHo$Q0_$OChMSYeQy{MIjbi3yJs`ju>og@!{Rbk-Zeq;txfZfX zd!o(NFC2vaflZOiH%fjU-;2<=bSmxnDM0po>sciqeB)`AR!Py_Y~GxZoK{sV8IJx>4t diff --git a/gui/themes/modern/THEMERC b/gui/themes/modern/THEMERC index 811f001ab84..6e7fff41ea4 100644 --- a/gui/themes/modern/THEMERC +++ b/gui/themes/modern/THEMERC @@ -1 +1 @@ -[SCUMMVM_STX0.8.10:ResidualVM Modern Theme:No Author] +[SCUMMVM_STX0.8.11:ResidualVM Modern Theme:No Author] diff --git a/gui/themes/modern/cursor.bmp b/gui/themes/modern/cursor.bmp index 35e846e33bb1e3e0ad888afc1468ba333ea10a2f..e7bdb60cada12ca51756ab269d91a7c0e0043aca 100644 GIT binary patch literal 3126 zcmeIyK?=e!5CzcbLJ$-LS1w(8f*!!V7m@D0WDnsDJVO2WWeBY{W%4UsSSBUZX_7W)FtkXU%i?!{X5*9zm=*0DFPrVM>ap%xPZI@FEW{6=@|60+I9{2oUxH`-LVVmW$47h#{>@k6 mAAKP{^tE`;m*c5F2cG(Y|1NCL2Hszf?Bc)z;(?7*wmbo0mjzz{ literal 3126 zcmeIyF$%&!5CzalkxD_ZvJ`AQK@MOq-XkE`c}Y7j;1N84pkKcXL!#L*JCPKI*|5aj zH{+~vv#qA`x+>h)7|Zu4WPuqjd_JFW@PWv!xc_6c9XMUi8sSAk-X9O;ti&C`M1ffV z0+)J)z=VnLFeHT*FV`I-+-J>0`0e7+A|8RSIRG1h;-8(5Xbxp|gH7hoMsc1mmbr_! zpe9nENuzvab@ChEeZKhOwm(|7PPAjb6iMGEa-^-|^}BJrGD$xNPx_g7x1W!9 s_#yZ=KMMco2jXo%7H|0Bxb=s?t?&5n!uDj~{nbb=b}S(7*w|;w16;@`P5=M^ diff --git a/gui/themes/modern/cursor_small.bmp b/gui/themes/modern/cursor_small.bmp index 1c20cda3250f99b27972ecf418f3a96544e5ec61..024a6d0b9b598105c357fa3d5c41861dd2638ab4 100644 GIT binary patch literal 1062 zcmZ?rRbycQ12Z700mMR3%*Y@C7XQEu6yt_qumF(w&+wlNL`{7WktuWLtikUH4Ey>U z=ZT1f>KlZYls4hfilI->z><;iC?n%#dk0UV_4T&RVdp4iV0gpF*M{GzVEcMI=4xsu z`1u!@nmI5qUS?oCr>PZ$$1($D literal 1062 zcmZ?rRbycQ12Z700mMR3%*Y@C7XQEu6yt_qumF(w!}y;JL`{7WDbaJ*EX3~!4Evhq z%@hgK(hs*TX{x}Z6+@q%l>y^XC&tTe_MVPJ>uZ}cg}qdp;f)_(n;Cwmg6->=H$^ki z(yt)G)X{?BiW|c@7tLTZJeC2a!1{mz!MNR)@vtM)DodbcKz3MCB+>d9KKMfrP@jsP zYF0%a9<50B!Sz8H%!R7cmd(bc6^B07&357Wakw-A#j)vQ+hiY9mW)ReHhnDH>_bYD z@N2@*2Mm#@yaa-pQ1t diff --git a/gui/themes/modern/modern_layout.stx b/gui/themes/modern/modern_layout.stx index 676de964e26..087a844a1b1 100644 --- a/gui/themes/modern/modern_layout.stx +++ b/gui/themes/modern/modern_layout.stx @@ -231,9 +231,6 @@ - diff --git a/gui/themes/modern/modern_layout_lowres.stx b/gui/themes/modern/modern_layout_lowres.stx index 00ff440d441..987fee800ab 100644 --- a/gui/themes/modern/modern_layout_lowres.stx +++ b/gui/themes/modern/modern_layout_lowres.stx @@ -214,9 +214,6 @@ -