From 992a8bfd3f05fc54aee3e25905d037ad0814a469 Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Fri, 16 Jul 2010 03:14:58 +0000 Subject: Cleanup. svn-id: r50925 --- gui/ThemeParser.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'gui') diff --git a/gui/ThemeParser.cpp b/gui/ThemeParser.cpp index 4cabf6ad2e..c809447cbd 100644 --- a/gui/ThemeParser.cpp +++ b/gui/ThemeParser.cpp @@ -365,10 +365,8 @@ bool ThemeParser::parserCallback_drawdata(ParserNode *node) { if (_theme->addDrawData(node->values["id"], cached) == false) return parserError("Error adding Draw Data set: Invalid DrawData name."); - if (_defaultStepLocal) { - delete _defaultStepLocal; - _defaultStepLocal = 0; - } + delete _defaultStepLocal; + _defaultStepLocal = 0; return true; } -- cgit v1.2.3 From 1d4c82885ddcc0442671c863eef643aef2dc7dda Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sat, 17 Jul 2010 18:38:42 +0000 Subject: DEBUGGER: Simplify how our console debugger works / is used * Remove _isAttached member var and isAttached method * Engines now always call the onFrame method; whether it does something is decided by the debugger class resp. its subclasses * Make detach() protected instead of private, so that subclasses can invoke it * Remove _detach_now member var (call detach() instead). * Rename _frame_countdown to _frameCountdown and properly document it. * Add more doxygen comments * Cleanup svn-id: r50963 --- gui/debugger.cpp | 61 ++++++++++++++--------------- gui/debugger.h | 116 +++++++++++++++++++++++++++++++++++++++++++++---------- 2 files changed, 124 insertions(+), 53 deletions(-) (limited to 'gui') diff --git a/gui/debugger.cpp b/gui/debugger.cpp index 13dc02452d..71728e8b13 100644 --- a/gui/debugger.cpp +++ b/gui/debugger.cpp @@ -39,9 +39,8 @@ namespace GUI { Debugger::Debugger() { - _frame_countdown = 0; - _detach_now = false; - _isAttached = false; + _frameCountdown = 0; + _isActive = false; _errStr = NULL; _firstTime = true; #ifndef USE_TEXT_CONSOLE @@ -50,6 +49,10 @@ Debugger::Debugger() { _debuggerDialog->setCompletionCallback(debuggerCompletionCallback, this); #endif + // Register variables + DVar_Register("debug_countdown", &_frameCountdown, DVAR_INT, 0); + + // Register commands //DCmd_Register("continue", WRAP_METHOD(Debugger, Cmd_Exit)); DCmd_Register("exit", WRAP_METHOD(Debugger, Cmd_Exit)); DCmd_Register("quit", WRAP_METHOD(Debugger, Cmd_Exit)); @@ -84,40 +87,32 @@ int Debugger::DebugPrintf(const char *format, ...) { } void Debugger::attach(const char *entry) { - g_system->setFeatureState(OSystem::kFeatureVirtualKeyboard, true); - if (entry) { - _errStr = strdup(entry); - } + // Set error string (if any) + free(_errStr); + _errStr = entry ? strdup(entry) : 0; - _frame_countdown = 1; - _detach_now = false; - _isAttached = true; + // Reset frame countdown (i.e. attach immediately) + _frameCountdown = 1; } void Debugger::detach() { g_system->setFeatureState(OSystem::kFeatureVirtualKeyboard, false); - - _detach_now = false; - _isAttached = false; } // Temporary execution handler void Debugger::onFrame() { - if (_frame_countdown == 0) - return; - --_frame_countdown; - - if (!_frame_countdown) { - - preEnter(); - enter(); - postEnter(); - - // Detach if we're finished with the debugger - if (_detach_now) - detach(); + // Count down until 0 is reached + if (_frameCountdown > 0) { + --_frameCountdown; + if (_frameCountdown == 0) { + _isActive = true; + preEnter(); + enter(); + postEnter(); + _isActive = false; + } } } @@ -250,8 +245,8 @@ bool Debugger::parseCommand(const char *inputOrig) { } else { int element = atoi(chr+1); int32 *var = *(int32 **)_dvars[i].variable; - if (element >= _dvars[i].optional) { - DebugPrintf("%s is out of range (array is %d elements big)\n", param[0], _dvars[i].optional); + if (element >= _dvars[i].arraySize) { + DebugPrintf("%s is out of range (array is %d elements big)\n", param[0], _dvars[i].arraySize); } else { var[element] = atoi(param[1]); DebugPrintf("(int)%s = %d\n", param[0], var[element]); @@ -281,8 +276,8 @@ bool Debugger::parseCommand(const char *inputOrig) { } else { int element = atoi(chr+1); const int32 *var = *(const int32 **)_dvars[i].variable; - if (element >= _dvars[i].optional) { - DebugPrintf("%s is out of range (array is %d elements big)\n", param[0], _dvars[i].optional); + if (element >= _dvars[i].arraySize) { + DebugPrintf("%s is out of range (array is %d elements big)\n", param[0], _dvars[i].arraySize); } else { DebugPrintf("(int)%s = %d\n", param[0], var[element]); } @@ -383,7 +378,7 @@ char *Debugger::readlineComplete(const char *input, int state) { #endif // Variable registration function -void Debugger::DVar_Register(const Common::String &varname, void *pointer, int type, int optional) { +void Debugger::DVar_Register(const Common::String &varname, void *pointer, int type, int arraySize) { // TODO: Filter out duplicates // TODO: Sort this list? Then we can do binary search later on when doing lookups. assert(pointer); @@ -392,7 +387,7 @@ void Debugger::DVar_Register(const Common::String &varname, void *pointer, int t tmp.name = varname; tmp.type = type; tmp.variable = pointer; - tmp.optional = optional; + tmp.arraySize = arraySize; _dvars.push_back(tmp); } @@ -406,7 +401,7 @@ void Debugger::DCmd_Register(const Common::String &cmdname, Debuglet *debuglet) // Detach ("exit") the debugger bool Debugger::Cmd_Exit(int argc, const char **argv) { - _detach_now = true; + detach(); return false; } diff --git a/gui/debugger.h b/gui/debugger.h index 07fdddb808..6f06befdf1 100644 --- a/gui/debugger.h +++ b/gui/debugger.h @@ -43,20 +43,46 @@ public: int DebugPrintf(const char *format, ...); + /** + * The onFrame() method should be invoked by the engine at regular + * intervals (usually once per main loop iteration) whenever the + * debugger is attached. + * This will open up the console and accept user input if certain + * preconditions are met, such as the frame countdown having + * reached zero. + * + * Subclasses can override this to e.g. check for breakpoints being + * triggered. + */ virtual void onFrame(); + /** + * 'Attach' the debugger. This ensures that the next time onFrame() + * is invoked, the debugger will activate and accept user input. + */ virtual void attach(const char *entry = 0); - bool isAttached() const { return _isAttached; } + + /** + * Return true if the debugger is currently active (i.e. executing + * a command or waiting for use input). + */ + bool isActive() const { return _isActive; } protected: typedef Common::Functor2 Debuglet; - // Convenience macro for registering a method of a debugger class - // as the current command. + /** + * Convenience macro that makes it either to register a method + * of a debugger subclass as a command. + * Usage example: + * DCmd_Register("COMMAND", WRAP_METHOD(MyDebugger, MyCmd)); + * would register the method MyDebugger::MyCmd(int, const char **) + * under the command name "COMMAND". + */ #define WRAP_METHOD(cls, method) \ new Common::Functor2Mem(this, &cls::method) - enum { + enum VarType { DVAR_BYTE, DVAR_INT, DVAR_BOOL, @@ -67,50 +93,100 @@ protected: struct DVar { Common::String name; void *variable; - int type; - int optional; + VarType type; + int arraySize; }; - int _frame_countdown; - bool _detach_now; + + /** + * Register a variable with the debugger. This allows the user to read and modify + * this variable. + * @param varname the identifier with which the user may access the variable + * @param variable pointer to the actual storage of the variable + * @param type the type of the variable (byte, int, bool, ...) + * @paral arraySize for type DVAR_INTARRAY this specifies the size of the array + * + * @todo replace this single method by type safe variants. + */ + void DVar_Register(const Common::String &varname, void *variable, VarType type, int arraySize); + void DCmd_Register(const Common::String &cmdname, Debuglet *debuglet); + private: + /** + * The frame countdown specifies a number of frames that must pass + * until the console will show up. This value is decremented by one + * each time onFrame() is called, until it reaches 0, at which point + * onFrame() will open the console and handle input into it. + * + * The user can modify this value using the debug_countdown command. + * + * Note: The console must be in *attached* state, otherwise, it + * won't show up (and the countdown won't count down either). + */ + uint _frameCountdown; + Common::Array _dvars; typedef Common::HashMap, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> CommandsMap; CommandsMap _cmds; - bool _isAttached; + /** + * True if the debugger is currently active (i.e. executing + * a command or waiting for use input). + */ + bool _isActive; + char *_errStr; + + /** + * Initially true, set to false when Debugger::enter is called + * the first time. We use this flag to show a greeting message + * to the user once, when he opens the debugger for the first + * time. + */ bool _firstTime; + #ifndef USE_TEXT_CONSOLE GUI::ConsoleDialog *_debuggerDialog; #endif protected: - // Hook for subclasses: Called just before enter() is run + /** + * Hook for subclasses which is called just before enter() is run. + * A typical usage example is pausing music and sound effects. + */ virtual void preEnter() {} - // Hook for subclasses: Called just after enter() was run + /** + * Hook for subclasses which is called just after enter() was run. + * A typical usage example is resuming music and sound effects. + */ virtual void postEnter() {} - // Hook for subclasses: Process the given command line. - // Should return true if and only if argv[0] is a known command and was - // handled, false otherwise. - virtual bool handleCommand(int argc, const char **argv, bool &keepRunning); - + /** + * Subclasses should invoke the detach() method in their Cmd_FOO methods + * if that command will resume execution of the program (as opposed to + * executing, say, a "single step through code" command). + * + * This currently only hides the virtual keyboard, if any. + */ + void detach(); private: - void detach(); void enter(); bool parseCommand(const char *input); bool tabComplete(const char *input, Common::String &completion) const; -protected: - void DVar_Register(const Common::String &varname, void *pointer, int type, int optional); - void DCmd_Register(const Common::String &cmdname, Debuglet *debuglet); + /** + * Process the given command line. + * Returns true if and only if argv[0] is a known command and was + * handled, false otherwise. + */ + virtual bool handleCommand(int argc, const char **argv, bool &keepRunning); +protected: bool Cmd_Exit(int argc, const char **argv); bool Cmd_Help(int argc, const char **argv); bool Cmd_DebugFlagsList(int argc, const char **argv); -- cgit v1.2.3 From 0b48a71c9955b39117e2eb35b3e398f5c95c008a Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sat, 17 Jul 2010 18:41:38 +0000 Subject: Remove PalmOS port svn-id: r50964 --- gui/ListWidget.cpp | 5 ----- gui/console.cpp | 4 ---- gui/credits.h | 5 ++--- 3 files changed, 2 insertions(+), 12 deletions(-) (limited to 'gui') diff --git a/gui/ListWidget.cpp b/gui/ListWidget.cpp index e08bc09b0b..4447b62244 100644 --- a/gui/ListWidget.cpp +++ b/gui/ListWidget.cpp @@ -439,11 +439,6 @@ bool ListWidget::handleKeyDown(Common::KeyState state) { _scrollBar->draw(); } -#if !defined(PALMOS_MODE) - // not done on PalmOS because keyboard is emulated and keyup is not generated - _currentKeyDown = state.keycode; -#endif - return handled; } diff --git a/gui/console.cpp b/gui/console.cpp index a2aa56f5b3..a53e97888b 100644 --- a/gui/console.cpp +++ b/gui/console.cpp @@ -669,11 +669,7 @@ int ConsoleDialog::printf(const char *format, ...) { } int ConsoleDialog::vprintf(const char *format, va_list argptr) { -#ifdef PALMOS_MODE - char buf[256]; -#else char buf[2048]; -#endif #if defined(WIN32) int count = _vsnprintf(buf, sizeof(buf), format, argptr); diff --git a/gui/credits.h b/gui/credits.h index ae658e1196..c0e1870226 100644 --- a/gui/credits.h +++ b/gui/credits.h @@ -213,9 +213,6 @@ static const char *credits[] = { "C1""Nintendo DS", "C0""Neil Millstone", "", -"C1""PalmOS", -"C0""Chris Apers", -"", "C1""PocketPC / WinCE", "C0""Nicolas Bacca", "C2""(retired)", @@ -286,6 +283,8 @@ static const char *credits[] = { "C2""Wiki editor", "", "C1""Retired Team Members", +"C0""Chris Apers", +"C2""Former PalmOS porter", "C0""Ralph Brorsen", "C2""Help with GUI implementation", "C0""Jamieson Christian", -- cgit v1.2.3 From 48b288d9aa3fdb6079ec5d5be1cc56f1f446f945 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sat, 17 Jul 2010 19:11:59 +0000 Subject: Fixing compilation with MSVC svn-id: r50966 --- gui/debugger.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gui') diff --git a/gui/debugger.cpp b/gui/debugger.cpp index 71728e8b13..9bd3b35915 100644 --- a/gui/debugger.cpp +++ b/gui/debugger.cpp @@ -378,7 +378,7 @@ char *Debugger::readlineComplete(const char *input, int state) { #endif // Variable registration function -void Debugger::DVar_Register(const Common::String &varname, void *pointer, int type, int arraySize) { +void Debugger::DVar_Register(const Common::String &varname, void *pointer, VarType type, int arraySize) { // TODO: Filter out duplicates // TODO: Sort this list? Then we can do binary search later on when doing lookups. assert(pointer); -- cgit v1.2.3 From 9977e2db90bf26ae4d956d2a61063f2b62b18780 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Mon, 19 Jul 2010 14:28:46 +0000 Subject: GUI: Enhance ThemeEngine to find theme .zip files using SearchMan This is based on the Android specific patch found under: backends/platform/android/scummvm-android-themeengine.patch After some testing we should be able to get rid of that custom patch. svn-id: r51028 --- gui/ThemeEngine.cpp | 97 +++++++++++++++++++++++++++++++++++------------------ gui/ThemeEngine.h | 2 ++ 2 files changed, 67 insertions(+), 32 deletions(-) (limited to 'gui') diff --git a/gui/ThemeEngine.cpp b/gui/ThemeEngine.cpp index 30bacbb617..91e32ce1e8 100644 --- a/gui/ThemeEngine.cpp +++ b/gui/ThemeEngine.cpp @@ -44,10 +44,6 @@ #include "gui/ThemeEval.h" #include "gui/ThemeParser.h" -#if defined(MACOSX) || defined(IPHONE) -#include -#endif - #define GUI_ENABLE_BUILTIN_THEME namespace GUI { @@ -396,15 +392,23 @@ bool ThemeEngine::init() { // Try to create a Common::Archive with the files of the theme. if (!_themeArchive && !_themeFile.empty()) { Common::FSNode node(_themeFile); - if (node.getName().hasSuffix(".zip") && !node.isDirectory()) { - Common::Archive *zipArchive = Common::makeZipArchive(node); - - if (!zipArchive) { - warning("Failed to open Zip archive '%s'.", node.getPath().c_str()); - } - _themeArchive = zipArchive; - } else if (node.isDirectory()) { + if (node.isDirectory()) { _themeArchive = new Common::FSDirectory(node); + } else if (_themeFile.hasSuffix(".zip")) { + // TODO: Also use "node" directly? + // Look for the zip file via SearchMan + Common::ArchiveMemberPtr member = SearchMan.getMember(_themeFile); + if (member) { + _themeArchive = Common::makeZipArchive(member->createReadStream()); + if (!_themeArchive) { + warning("Failed to open Zip archive '%s'.", member->getDisplayName().c_str()); + } + } else { + _themeArchive = Common::makeZipArchive(node); + if (!_themeArchive) { + warning("Failed to open Zip archive '%s'.", node.getPath().c_str()); + } + } } } @@ -1553,6 +1557,28 @@ bool ThemeEngine::themeConfigParseHeader(Common::String header, Common::String & return tok.empty(); } +bool ThemeEngine::themeConfigUsable(const Common::ArchiveMember &member, Common::String &themeName) { + Common::File stream; + bool foundHeader = false; + + if (member.getName().hasSuffix(".zip")) { + Common::Archive *zipArchive = Common::makeZipArchive(member.createReadStream()); + + if (zipArchive && zipArchive->hasFile("THEMERC")) { + stream.open("THEMERC", *zipArchive); + } + + delete zipArchive; + } + + if (stream.isOpen()) { + Common::String stxHeader = stream.readLine(); + foundHeader = themeConfigParseHeader(stxHeader, themeName); + } + + return foundHeader; +} + bool ThemeEngine::themeConfigUsable(const Common::FSNode &node, Common::String &themeName) { Common::File stream; bool foundHeader = false; @@ -1608,26 +1634,7 @@ void ThemeEngine::listUsableThemes(Common::List &list) { if (ConfMan.hasKey("themepath")) listUsableThemes(Common::FSNode(ConfMan.get("themepath")), list); -#ifdef DATA_PATH - listUsableThemes(Common::FSNode(DATA_PATH), list); -#endif - -#if defined(MACOSX) || defined(IPHONE) - CFURLRef resourceUrl = CFBundleCopyResourcesDirectoryURL(CFBundleGetMainBundle()); - if (resourceUrl) { - char buf[256]; - if (CFURLGetFileSystemRepresentation(resourceUrl, true, (UInt8 *)buf, 256)) { - Common::FSNode resourcePath(buf); - listUsableThemes(resourcePath, list); - } - CFRelease(resourceUrl); - } -#endif - - if (ConfMan.hasKey("extrapath")) - listUsableThemes(Common::FSNode(ConfMan.get("extrapath")), list); - - listUsableThemes(Common::FSNode("."), list, 1); + listUsableThemes(SearchMan, list); // Now we need to strip all duplicates // TODO: It might not be the best idea to strip duplicates. The user might @@ -1646,6 +1653,32 @@ void ThemeEngine::listUsableThemes(Common::List &list) { output.clear(); } +void ThemeEngine::listUsableThemes(Common::Archive &archive, Common::List &list) { + ThemeDescriptor td; + + Common::ArchiveMemberList fileList; + archive.listMatchingMembers(fileList, "*.zip"); + for (Common::ArchiveMemberList::iterator i = fileList.begin(); + i != fileList.end(); ++i) { + td.name.clear(); + if (themeConfigUsable(**i, td.name)) { + td.filename = (*i)->getName(); + td.id = (*i)->getDisplayName(); + + // If the name of the node object also contains + // the ".zip" suffix, we will strip it. + if (td.id.hasSuffix(".zip")) { + for (int j = 0; j < 4; ++j) + td.id.deleteLastChar(); + } + + list.push_back(td); + } + } + + fileList.clear(); +} + void ThemeEngine::listUsableThemes(const Common::FSNode &node, Common::List &list, int depth) { if (!node.exists() || !node.isReadable() || !node.isDirectory()) return; diff --git a/gui/ThemeEngine.h b/gui/ThemeEngine.h index f0d4e2585d..3173aa4aca 100644 --- a/gui/ThemeEngine.h +++ b/gui/ThemeEngine.h @@ -583,11 +583,13 @@ public: static void listUsableThemes(Common::List &list); private: static bool themeConfigUsable(const Common::FSNode &node, Common::String &themeName); + static bool themeConfigUsable(const Common::ArchiveMember &member, Common::String &themeName); static bool themeConfigParseHeader(Common::String header, Common::String &themeName); static Common::String getThemeFile(const Common::String &id); static Common::String getThemeId(const Common::String &filename); static void listUsableThemes(const Common::FSNode &node, Common::List &list, int depth = -1); + static void listUsableThemes(Common::Archive &archive, Common::List &list); protected: OSystem *_system; /** Global system object. */ -- cgit v1.2.3 From e5e94d45118781902465024fc9a85c7aa0bfd3ce Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Wed, 21 Jul 2010 18:17:51 +0000 Subject: Strip trailing whitespaces in our common code base. svn-id: r51094 --- gui/ThemeEngine.cpp | 2 +- gui/options.cpp | 4 ++-- gui/widget.cpp | 6 +++--- gui/widget.h | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) (limited to 'gui') diff --git a/gui/ThemeEngine.cpp b/gui/ThemeEngine.cpp index 91e32ce1e8..6c2d8f1f7f 100644 --- a/gui/ThemeEngine.cpp +++ b/gui/ThemeEngine.cpp @@ -1229,7 +1229,7 @@ void ThemeEngine::restoreState(StoredState *state) { src += state->backBuffer.pitch; dst += _backBuffer.pitch; } - + addDirtyRect(state->r); } diff --git a/gui/options.cpp b/gui/options.cpp index 856eb668fa..0553e5910a 100644 --- a/gui/options.cpp +++ b/gui/options.cpp @@ -790,7 +790,7 @@ bool OptionsDialog::loadMusicDeviceSetting(PopUpWidget *popup, Common::String se return true; if (_domain != Common::ConfigManager::kApplicationDomain || ConfMan.hasKey(setting, _domain) || preferredType) { - const Common::String drv = ConfMan.get(setting, (_domain != Common::ConfigManager::kApplicationDomain && !ConfMan.hasKey(setting, _domain)) ? Common::ConfigManager::kApplicationDomain : _domain); + const Common::String drv = ConfMan.get(setting, (_domain != Common::ConfigManager::kApplicationDomain && !ConfMan.hasKey(setting, _domain)) ? Common::ConfigManager::kApplicationDomain : _domain); const MusicPlugin::List p = MusicMan.getPlugins(); for (MusicPlugin::List::const_iterator m = p.begin(); m != p.end(); ++m) { @@ -810,7 +810,7 @@ bool OptionsDialog::loadMusicDeviceSetting(PopUpWidget *popup, Common::String se void OptionsDialog::saveMusicDeviceSetting(PopUpWidget *popup, Common::String setting) { if (!popup || !_enableAudioSettings) return; - + const MusicPlugin::List p = MusicMan.getPlugins(); bool found = false; for (MusicPlugin::List::const_iterator m = p.begin(); m != p.end() && !found; ++m) { diff --git a/gui/widget.cpp b/gui/widget.cpp index 14cb61006b..6dd79c9d4f 100644 --- a/gui/widget.cpp +++ b/gui/widget.cpp @@ -218,9 +218,9 @@ Common::String Widget::cleanupHotkey(const Common::String &label) { for (uint i = 0; i < label.size() ; i++) if (label[i] != '~') res = res + label[i]; - + return res; -} +} #pragma mark - @@ -361,7 +361,7 @@ ButtonWidget::ButtonWidget(GuiObject *boss, int x, int y, int w, int h, const Co } ButtonWidget::ButtonWidget(GuiObject *boss, const Common::String &name, const Common::String &label, const char *tooltip, uint32 cmd, uint8 hotkey) - : StaticTextWidget(boss, name, cleanupHotkey(label), tooltip), CommandSender(boss), + : StaticTextWidget(boss, name, cleanupHotkey(label), tooltip), CommandSender(boss), _cmd(cmd) { if (hotkey == 0) _hotkey = parseHotkey(label); diff --git a/gui/widget.h b/gui/widget.h index 7b5fe9253f..25e4b9a235 100644 --- a/gui/widget.h +++ b/gui/widget.h @@ -164,7 +164,7 @@ class GuiManager; class Tooltip : public GuiObject { public: Tooltip(GuiManager *guiManager); - + bool isVisible() const { return _visible; } void draw(); void reflowLayout(); @@ -272,7 +272,7 @@ class RadiobuttonWidget : public ButtonWidget { protected: bool _state; int _value; - + public: RadiobuttonWidget(GuiObject *boss, int x, int y, int w, int h, RadiobuttonGroup *group, int value, const Common::String &label, const char *tooltip = 0, uint8 hotkey = 0); RadiobuttonWidget(GuiObject *boss, const Common::String &name, RadiobuttonGroup *group, int value, const Common::String &label, const char *tooltip = 0, uint8 hotkey = 0); -- cgit v1.2.3 From 41190f8a7bf74087b113227fb831780d647ade05 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Wed, 21 Jul 2010 20:37:46 +0000 Subject: GUI: Properly show external MIDI devices. Formerly in case a game only specified GUIO_MIDIMT32, only the MT-32 Emulator was shown, since that is the only device which is of type MT_MT32. All external MIDI devices are currently only flagged with MT_GM. svn-id: r51107 --- gui/options.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'gui') diff --git a/gui/options.cpp b/gui/options.cpp index 0553e5910a..ed56630a62 100644 --- a/gui/options.cpp +++ b/gui/options.cpp @@ -657,9 +657,15 @@ void OptionsDialog::addAudioControls(GuiObject *boss, const Common::String &pref for (MusicPlugin::List::const_iterator m = p.begin(); m != p.end(); ++m) { MusicDevices i = (**m)->getDevices(); for (MusicDevices::iterator d = i.begin(); d != i.end(); ++d) { + const uint32 deviceGuiOption = MidiDriver::musicType2GUIO(d->getMusicType()); + if ((_domain == Common::ConfigManager::kApplicationDomain && d->getMusicType() != MT_TOWNS) // global dialog - skip useless FM-Towns option there || (_domain != Common::ConfigManager::kApplicationDomain && !(_guioptions & allFlags)) // No flags are specified - || _guioptions & (MidiDriver::musicType2GUIO(d->getMusicType())) // flag is present + || (_guioptions & deviceGuiOption) // flag is present + // HACK/FIXME: For now we have to show GM devices, even when the game only has GUIO_MIDIMT32 set, + // else we would not show for example external devices connected via ALSA, since they are always + // marked as General MIDI device. + || (deviceGuiOption == Common::GUIO_MIDIGM && (_guioptions & Common::GUIO_MIDIMT32)) || d->getMusicDriverId() == "auto" || d->getMusicDriverId() == "null") // always add default and null device _midiPopUp->appendEntry(d->getCompleteName(), d->getHandle()); -- cgit v1.2.3 From d6695e180cfedb723a670d94d8ed132ed896498d Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Fri, 23 Jul 2010 19:36:47 +0000 Subject: GUI: Fix tooltip drawing With help of Tanoku tooltips were switched from widgets to dialogs which helped to fix nasty bug with background not being restored. Although it is basically a hack around inconsistent font backbuffering in our GUI code, for the time being it is feasible. The patch was extended with way to specify tooltip background in the theme file. svn-id: r51217 --- gui/GuiManager.cpp | 36 +++++----- gui/GuiManager.h | 6 +- gui/ThemeEngine.cpp | 5 ++ gui/ThemeEngine.h | 2 + gui/Tooltip.cpp | 101 +++++++++++++++++++++++++++++ gui/Tooltip.h | 50 ++++++++++++++ gui/module.mk | 1 + gui/themes/default.inc | 7 ++ gui/themes/scummclassic.zip | Bin 56900 -> 57060 bytes gui/themes/scummclassic/classic_gfx.stx | 8 +++ gui/themes/scummmodern.zip | Bin 164185 -> 164369 bytes gui/themes/scummmodern/scummmodern_gfx.stx | 9 +++ gui/widget.cpp | 77 ---------------------- gui/widget.h | 25 ------- 14 files changed, 207 insertions(+), 120 deletions(-) create mode 100644 gui/Tooltip.cpp create mode 100644 gui/Tooltip.h (limited to 'gui') diff --git a/gui/GuiManager.cpp b/gui/GuiManager.cpp index ff747c6e92..ab370425ab 100644 --- a/gui/GuiManager.cpp +++ b/gui/GuiManager.cpp @@ -45,11 +45,12 @@ namespace GUI { enum { kDoubleClickDelay = 500, // milliseconds - kCursorAnimateDelay = 250 + kCursorAnimateDelay = 250, + kTooltipDelay = 1250 }; // Constructor -GuiManager::GuiManager() : _redrawStatus(kRedrawDisabled), +GuiManager::GuiManager() : _redrawStatus(kRedrawDisabled), _tooltipCheck(false), _stateIsSaved(false), _cursorAnimateCounter(0), _cursorAnimateTimer(0) { _theme = 0; _useStdCursor = false; @@ -77,7 +78,7 @@ GuiManager::GuiManager() : _redrawStatus(kRedrawDisabled), } } - _tooltip = new Tooltip(this); + _tooltip = 0; } GuiManager::~GuiManager() { @@ -224,13 +225,6 @@ Dialog *GuiManager::getTopDialog() const { return _dialogStack.top(); } -static void tooltipCallback(void *ref) { - GuiManager *guiManager = (GuiManager *)ref; - - guiManager->getTooltip()->setVisible(true); - g_system->getTimerManager()->removeTimerProc(&tooltipCallback); -} - void GuiManager::runLoop() { Dialog *activeDialog = getTopDialog(); bool didSaveState = false; @@ -321,7 +315,14 @@ void GuiManager::runLoop() { break; case Common::EVENT_MOUSEMOVE: activeDialog->handleMouseMoved(mouse.x, mouse.y, 0); - _tooltip->setMouseXY(mouse.x, mouse.y); + + if (mouse.x != _lastMousePosition.x || mouse.y != _lastMousePosition.y) { + _lastMousePosition.x = mouse.x; + _lastMousePosition.y = mouse.y; + _lastMousePosition.time = _system->getMillis(); + } + + _tooltipCheck = true; eventTookplace = true; break; // We don't distinguish between mousebuttons (for now at least) @@ -367,11 +368,16 @@ void GuiManager::runLoop() { } } - if (eventTookplace) { - _tooltip->setVisible(false); + if (_tooltipCheck && _lastMousePosition.time + kTooltipDelay < _system->getMillis()) { + if (_tooltip == 0) + _tooltip = new Tooltip(); + + _tooltipCheck = false; + _tooltip->tooltipModal(_lastMousePosition.x, _lastMousePosition.y); + } - _system->getTimerManager()->removeTimerProc(&tooltipCallback); - _system->getTimerManager()->installTimerProc(&tooltipCallback, 2*1000000, this); + if (eventTookplace && _tooltip) { + _tooltip->mustClose(); } // Delay for a moment diff --git a/gui/GuiManager.h b/gui/GuiManager.h index 2a187a92f9..ee1351dc9b 100644 --- a/gui/GuiManager.h +++ b/gui/GuiManager.h @@ -33,6 +33,7 @@ #include "graphics/font.h" #include "gui/widget.h" +#include "gui/Tooltip.h" #include "gui/ThemeEngine.h" class OSystem; @@ -93,8 +94,6 @@ public: */ bool checkScreenChange(); - Tooltip *getTooltip() { return _tooltip; } - protected: enum RedrawStatus { kRedrawDisabled = 0, @@ -119,13 +118,14 @@ protected: bool _useStdCursor; Tooltip *_tooltip; + bool _tooltipCheck; // position and time of last mouse click (used to detect double clicks) struct { int16 x, y; // Position of mouse when the click occurred uint32 time; // Time int count; // How often was it already pressed? - } _lastClick; + } _lastClick, _lastMousePosition; // mouse cursor state int _cursorAnimateCounter; diff --git a/gui/ThemeEngine.cpp b/gui/ThemeEngine.cpp index 6c2d8f1f7f..874df9e947 100644 --- a/gui/ThemeEngine.cpp +++ b/gui/ThemeEngine.cpp @@ -165,6 +165,7 @@ static const DrawDataInfo kDrawDataDefaults[] = { {kDDMainDialogBackground, "mainmenu_bg", true, kDDNone}, {kDDSpecialColorBackground, "special_bg", true, kDDNone}, {kDDPlainColorBackground, "plain_bg", true, kDDNone}, + {kDDTooltipBackground, "tooltip_bg", true, kDDNone}, {kDDDefaultBackground, "default_bg", true, kDDNone}, {kDDTextSelectionBackground, "text_selection", false, kDDNone}, {kDDTextSelectionFocusBackground, "text_selection_focus", false, kDDNone}, @@ -984,6 +985,10 @@ void ThemeEngine::drawDialogBackground(const Common::Rect &r, DialogBackground b queueDD(kDDPlainColorBackground, r); break; + case kDialogBackgroundTooltip: + queueDD(kDDTooltipBackground, r); + break; + case kDialogBackgroundDefault: queueDD(kDDDefaultBackground, r); break; diff --git a/gui/ThemeEngine.h b/gui/ThemeEngine.h index 3173aa4aca..f736559def 100644 --- a/gui/ThemeEngine.h +++ b/gui/ThemeEngine.h @@ -61,6 +61,7 @@ enum DrawData { kDDMainDialogBackground, kDDSpecialColorBackground, kDDPlainColorBackground, + kDDTooltipBackground, kDDDefaultBackground, kDDTextSelectionBackground, kDDTextSelectionFocusBackground, @@ -162,6 +163,7 @@ public: kDialogBackgroundMain, kDialogBackgroundSpecial, kDialogBackgroundPlain, + kDialogBackgroundTooltip, kDialogBackgroundDefault }; diff --git a/gui/Tooltip.cpp b/gui/Tooltip.cpp new file mode 100644 index 0000000000..64c34688df --- /dev/null +++ b/gui/Tooltip.cpp @@ -0,0 +1,101 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * $URL$ + * $Id$ + */ + +#include "common/util.h" +#include "graphics/fontman.h" +#include "gui/widget.h" +#include "gui/dialog.h" +#include "gui/GuiManager.h" + +#include "gui/Tooltip.h" +#include "gui/ThemeEval.h" + +namespace GUI { + + +Tooltip::Tooltip() : + Dialog(-1, -1, -1, -1), _maxWidth(-1) { + + _backgroundType = GUI::ThemeEngine::kDialogBackgroundTooltip; +} + +void Tooltip::mustClose() { + if (isVisible()) + Dialog::close(); +} + +bool Tooltip::tooltipModal(int x, int y) { + Widget *wdg; + + if (!g_gui.getTopDialog()) + return false; + + wdg = g_gui.getTopDialog()->findWidget(x, y); + + if (!wdg || !wdg->getTooltip()) + return false; + + if (_maxWidth == -1) { + _maxWidth = g_gui.xmlEval()->getVar("Globals.Tooltip.MaxWidth", 100); + _xdelta = g_gui.xmlEval()->getVar("Globals.Tooltip.XDelta", 0); + _ydelta = g_gui.xmlEval()->getVar("Globals.Tooltip.YDelta", 0); + } + + const Graphics::Font *tooltipFont = g_gui.theme()->getFont(ThemeEngine::kFontStyleTooltip); + + _wrappedLines.clear(); + _w = tooltipFont->wordWrapText(wdg->getTooltip(), _maxWidth - 4, _wrappedLines); + _h = (tooltipFont->getFontHeight() + 2) * _wrappedLines.size(); + + _x = MIN(g_gui.getTopDialog()->_x + x + _xdelta, g_gui.getWidth() - _w - 3); + _y = MIN(g_gui.getTopDialog()->_y + y + _ydelta, g_gui.getHeight() - _h - 3); + + open(); + g_gui.runLoop(); + + return true; +} + +void Tooltip::drawDialog() { + int num = 0; + int h = g_gui.theme()->getFontHeight(ThemeEngine::kFontStyleTooltip) + 2; + + Dialog::drawDialog(); + + for (Common::StringArray::const_iterator i = _wrappedLines.begin(); i != _wrappedLines.end(); ++i, ++num) { + g_gui.theme()->drawText( + Common::Rect(_x + 1, _y + 1 + num * h, _x + 1 +_w, _y + 1+ (num + 1) * h), *i, + ThemeEngine::kStateEnabled, + Graphics::kTextAlignLeft, + ThemeEngine::kTextInversionNone, + 0, + false, + ThemeEngine::kFontStyleTooltip, + ThemeEngine::kFontColorNormal, + false + ); + } +} + +} diff --git a/gui/Tooltip.h b/gui/Tooltip.h new file mode 100644 index 0000000000..60f3cf3a19 --- /dev/null +++ b/gui/Tooltip.h @@ -0,0 +1,50 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * $URL$ + * $Id$ + */ + +#ifndef GUI_TOOLTIP_H +#define GUI_TOOLTIP_H + +#include "gui/dialog.h" + +namespace GUI { + +class Tooltip : public Dialog { +public: + Tooltip(); + ~Tooltip() {} + + void drawDialog(); + bool tooltipModal(int x, int y); + void mustClose(); + +protected: + Common::String _text; + int _maxWidth; + int _xdelta, _ydelta; + + Common::StringArray _wrappedLines; +}; +} + +#endif diff --git a/gui/module.mk b/gui/module.mk index 9bf1a08d4b..72b5fa18f3 100644 --- a/gui/module.mk +++ b/gui/module.mk @@ -25,6 +25,7 @@ MODULE_OBJS := \ ThemeEval.o \ ThemeLayout.o \ ThemeParser.o \ + Tooltip.o \ widget.o ifdef MACOSX diff --git a/gui/themes/default.inc b/gui/themes/default.inc index 086fecc123..915ec55dca 100644 --- a/gui/themes/default.inc +++ b/gui/themes/default.inc @@ -877,6 +877,13 @@ "bevel='2' " "/> " " " +" " +" " +" " " " " + + + + + + + + + getFontHeight(ThemeEngine::kFontStyleTooltip) + 2; - - // Make Rect bigger for compensating the shadow - _storedState = g_gui.theme()->storeState(Common::Rect(_x - 5, _y - 5, _x + _w + 5, _y + _h + 5)); - - g_gui.theme()->startBuffering(); - g_gui.theme()->drawWidgetBackground(Common::Rect(_x, _y, _x + _w, _y + _h), 0, ThemeEngine::kWidgetBackgroundBorderSmall); - - for (Common::StringArray::const_iterator i = _wrappedLines.begin(); i != _wrappedLines.end(); ++i, ++num) { - g_gui.theme()->drawText(Common::Rect(_x + 1, _y + 1 + num * h, _x + 1 +_w, _y + 1+ (num + 1) * h), *i, ThemeEngine::kStateEnabled, Graphics::kTextAlignLeft, ThemeEngine::kTextInversionNone, 0, false, ThemeEngine::kFontStyleTooltip, ThemeEngine::kFontColorNormal, false); - } - g_gui.theme()->finishBuffering(); -} - -void Tooltip::reflowLayout() { -} - -void Tooltip::setMouseXY(int x, int y) { - _mouseX = x; - _mouseY = y; -} - -void Tooltip::setVisible(bool state) { - if (state == _visible) - return; - - if (state) { - if (!_guiManager->getTopDialog()) - return; - - Widget *wdg = _guiManager->getTopDialog()->findWidget(_mouseX, _mouseY); - - if (!wdg) - return; - - if (wdg->getTooltip()) { - _visible = state; - - // Cache config values. - // NOTE: we cannot do it in the consturctor - if (_maxWidth == -1) { - _maxWidth = g_gui.xmlEval()->getVar("Globals.Tooltip.MaxWidth", 100); - _xdelta = g_gui.xmlEval()->getVar("Globals.Tooltip.XDelta", 0); - _ydelta = g_gui.xmlEval()->getVar("Globals.Tooltip.YDelta", 0); - } - - const Graphics::Font *tooltipFont = g_gui.theme()->getFont(ThemeEngine::kFontStyleTooltip); - - _wrappedLines.clear(); - _w = tooltipFont->wordWrapText(wdg->getTooltip(), _maxWidth - 4, _wrappedLines); - _h = (tooltipFont->getFontHeight() + 2) * _wrappedLines.size(); - - _x = MIN(_guiManager->getTopDialog()->_x + _mouseX + _xdelta, g_gui.getWidth() - _w - 3); - _y = MIN(_guiManager->getTopDialog()->_y + _mouseY + _ydelta, g_gui.getHeight() - _h - 3); - - draw(); - } - } else { - _visible = state; - - g_gui.theme()->restoreState(_storedState); - delete _storedState; - } -} - -#pragma mark - - StaticTextWidget::StaticTextWidget(GuiObject *boss, int x, int y, int w, int h, const Common::String &text, Graphics::TextAlign align, const char *tooltip) : Widget(boss, x, y, w, h, tooltip), _align(align) { setFlags(WIDGET_ENABLED); diff --git a/gui/widget.h b/gui/widget.h index 25e4b9a235..92bfbf8256 100644 --- a/gui/widget.h +++ b/gui/widget.h @@ -159,31 +159,6 @@ protected: void handleCommand(CommandSender *sender, uint32 cmd, uint32 data) { assert(_boss); _boss->handleCommand(sender, cmd, data); } }; -class GuiManager; - -class Tooltip : public GuiObject { -public: - Tooltip(GuiManager *guiManager); - - bool isVisible() const { return _visible; } - void draw(); - void reflowLayout(); - void releaseFocus() {} - void setVisible(bool state); - void setMouseXY(int x, int y); - -protected: - Common::String _text; - GuiManager *_guiManager; - bool _visible; - int _mouseX, _mouseY; - int _maxWidth; - int _xdelta, _ydelta; - - Common::StringArray _wrappedLines; - ThemeEngine::StoredState *_storedState; -}; - /* StaticTextWidget */ class StaticTextWidget : public Widget { protected: -- cgit v1.2.3 From 1867b44bf4fd9e1cfb9861f7e0e3ed65ba5144a7 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Fri, 23 Jul 2010 21:26:30 +0000 Subject: GUI: Fix bug #3024930 Bug #3024930: "GUI: GMM errors out in Hercules mode". Fixed by switching Hercules resolutions to lowres GUI. svn-id: r51226 --- gui/themes/default.inc | 4 ++-- gui/themes/scummclassic.zip | Bin 57060 -> 57075 bytes gui/themes/scummclassic/classic_layout.stx | 2 +- gui/themes/scummclassic/classic_layout_lowres.stx | 2 +- gui/themes/scummmodern.zip | Bin 164369 -> 164384 bytes gui/themes/scummmodern/scummmodern_layout.stx | 2 +- .../scummmodern/scummmodern_layout_lowres.stx | 2 +- 7 files changed, 6 insertions(+), 6 deletions(-) (limited to 'gui') diff --git a/gui/themes/default.inc b/gui/themes/default.inc index 915ec55dca..11460e7199 100644 --- a/gui/themes/default.inc +++ b/gui/themes/default.inc @@ -1,5 +1,5 @@ "" -" " +" " " " " " " " @@ -1216,7 +1216,7 @@ "/> " " " " " -" " +" " " " " " " " diff --git a/gui/themes/scummclassic.zip b/gui/themes/scummclassic.zip index 4a31a8ebb9..b6b4ffe2e7 100644 Binary files a/gui/themes/scummclassic.zip and b/gui/themes/scummclassic.zip differ diff --git a/gui/themes/scummclassic/classic_layout.stx b/gui/themes/scummclassic/classic_layout.stx index 80bc4bf41e..0a38ea4b40 100644 --- a/gui/themes/scummclassic/classic_layout.stx +++ b/gui/themes/scummclassic/classic_layout.stx @@ -23,7 +23,7 @@ - $Id$ - --> - + diff --git a/gui/themes/scummclassic/classic_layout_lowres.stx b/gui/themes/scummclassic/classic_layout_lowres.stx index 64ac6e200a..76838f5476 100644 --- a/gui/themes/scummclassic/classic_layout_lowres.stx +++ b/gui/themes/scummclassic/classic_layout_lowres.stx @@ -23,7 +23,7 @@ - $Id$ - --> - + diff --git a/gui/themes/scummmodern.zip b/gui/themes/scummmodern.zip index b5e8f24019..dacec7f580 100644 Binary files a/gui/themes/scummmodern.zip and b/gui/themes/scummmodern.zip differ diff --git a/gui/themes/scummmodern/scummmodern_layout.stx b/gui/themes/scummmodern/scummmodern_layout.stx index 796d4d9a94..3dac5f0f3f 100644 --- a/gui/themes/scummmodern/scummmodern_layout.stx +++ b/gui/themes/scummmodern/scummmodern_layout.stx @@ -23,7 +23,7 @@ - $Id$ - --> - + diff --git a/gui/themes/scummmodern/scummmodern_layout_lowres.stx b/gui/themes/scummmodern/scummmodern_layout_lowres.stx index 8bb31e9f8a..42e61286aa 100644 --- a/gui/themes/scummmodern/scummmodern_layout_lowres.stx +++ b/gui/themes/scummmodern/scummmodern_layout_lowres.stx @@ -23,7 +23,7 @@ - $Id$ - --> - + -- cgit v1.2.3 From 7457011a87cb54c4d6b7cc6bc7b4719b1c9a2b99 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sat, 24 Jul 2010 22:29:17 +0000 Subject: GUI: Fix bug #3027772 by adding MT-32 tab Bug #3027772: "Can't switch between Text and Speech". The problem was in overcrowded Audio tab in any resolution with height < 480. Solved by adding new MT-32 tab and grouping all relevant widgets there. TODO: - The problem still exists for 320x200 resolution where Subtitle speed control is not accessible - Apparently nobody tested tab control scrolling after switching to new GUI, and now there are artifacts svn-id: r51265 --- gui/launcher.cpp | 34 +++- gui/options.cpp | 179 +++++++++++++-------- gui/options.h | 11 +- gui/themes/scummclassic.zip | Bin 57075 -> 58134 bytes gui/themes/scummclassic/classic_layout.stx | 58 ++++--- gui/themes/scummclassic/classic_layout_lowres.stx | 56 ++++--- gui/themes/scummmodern.zip | Bin 164384 -> 165317 bytes gui/themes/scummmodern/scummmodern_layout.stx | 58 ++++--- .../scummmodern/scummmodern_layout_lowres.stx | 62 ++++--- 9 files changed, 298 insertions(+), 160 deletions(-) (limited to 'gui') diff --git a/gui/launcher.cpp b/gui/launcher.cpp index 1daf9ffd50..d50e7ce578 100644 --- a/gui/launcher.cpp +++ b/gui/launcher.cpp @@ -72,6 +72,7 @@ enum { kCmdGlobalGraphicsOverride = 'OGFX', kCmdGlobalAudioOverride = 'OSFX', kCmdGlobalMIDIOverride = 'OMID', + kCmdGlobalMT32Override = 'OM32', kCmdGlobalVolumeOverride = 'OVOL', kCmdChooseSoundFontCmd = 'chsf', @@ -144,6 +145,7 @@ protected: CheckboxWidget *_globalGraphicsOverride; CheckboxWidget *_globalAudioOverride; CheckboxWidget *_globalMIDIOverride; + CheckboxWidget *_globalMT32Override; CheckboxWidget *_globalVolumeOverride; }; @@ -199,7 +201,7 @@ EditGameDialog::EditGameDialog(const String &domain, const String &desc) } // - // 3) The graphics tab + // 2) The graphics tab // _graphicsTabId = tab->addTab(g_system->getOverlayWidth() > 320 ? _("Graphics") : _("GFX")); @@ -208,7 +210,7 @@ EditGameDialog::EditGameDialog(const String &domain, const String &desc) addGraphicControls(tab, "GameOptions_Graphics."); // - // 4) The audio tab + // 3) The audio tab // tab->addTab(_("Audio")); @@ -218,7 +220,7 @@ EditGameDialog::EditGameDialog(const String &domain, const String &desc) addSubtitleControls(tab, "GameOptions_Audio."); // - // 5) The volume tab + // 4) The volume tab // tab->addTab(_("Volume")); @@ -227,7 +229,7 @@ EditGameDialog::EditGameDialog(const String &domain, const String &desc) addVolumeControls(tab, "GameOptions_Volume."); // - // 6) The MIDI tab + // 5) The MIDI tab // tab->addTab(_("MIDI")); @@ -239,7 +241,19 @@ EditGameDialog::EditGameDialog(const String &domain, const String &desc) addMIDIControls(tab, "GameOptions_MIDI."); // - // 2) The 'Path' tab + // 6) The MT-32 tab + // + tab->addTab(_("MT-32")); + + _globalMT32Override = new CheckboxWidget(tab, "GameOptions_MT32.EnableTabCheckbox", _("Override global MT-32 settings"), 0, kCmdGlobalMT32Override); + + //if (_guioptions & Common::GUIO_NOMIDI) + // _globalMT32Override->setEnabled(false); + + addMT32Controls(tab, "GameOptions_MT32."); + + // + // 7) The Paths tab // tab->addTab(_("Paths")); @@ -305,11 +319,13 @@ void EditGameDialog::open() { e = ConfMan.hasKey("soundfont", _domain) || ConfMan.hasKey("multi_midi", _domain) || - ConfMan.hasKey("native_mt32", _domain) || - ConfMan.hasKey("enable_gs", _domain) || ConfMan.hasKey("midi_gain", _domain); _globalMIDIOverride->setState(e); + e = ConfMan.hasKey("native_mt32", _domain) || + ConfMan.hasKey("enable_gs", _domain); + _globalMT32Override->setState(e); + // TODO: game path const Common::Language lang = Common::parseLanguage(ConfMan.get("language", _domain)); @@ -383,6 +399,10 @@ void EditGameDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 dat setMIDISettingsState(data != 0); draw(); break; + case kCmdGlobalMT32Override: + setMT32SettingsState(data != 0); + draw(); + break; case kCmdGlobalVolumeOverride: setVolumeSettingsState(data != 0); draw(); diff --git a/gui/options.cpp b/gui/options.cpp index ed56630a62..8ddd263a46 100644 --- a/gui/options.cpp +++ b/gui/options.cpp @@ -100,13 +100,14 @@ void OptionsDialog::init() { _aspectCheckbox = 0; _enableAudioSettings = false; _midiPopUp = 0; - _mt32DevicePopUp = 0; - _gmDevicePopUp = 0; _oplPopUp = 0; _outputRatePopUp = 0; _enableMIDISettings = false; + _gmDevicePopUp = 0; _multiMidiCheckbox = 0; + _enableMT32Settings = false; _mt32Checkbox = 0; + _mt32DevicePopUp = 0; _enableGSCheckbox = 0; _enableVolumeSettings = false; _musicVolumeDesc = 0; @@ -197,24 +198,6 @@ void OptionsDialog::open() { if (!loadMusicDeviceSetting(_midiPopUp, "music_driver")) _midiPopUp->setSelected(0); - if (!loadMusicDeviceSetting(_mt32DevicePopUp, "mt32_device")) { - if (_domain.equals(Common::ConfigManager::kApplicationDomain)) { - if (!loadMusicDeviceSetting(_mt32DevicePopUp, Common::String(), MT_MT32)) - _mt32DevicePopUp->setSelected(0); - } else { - _mt32DevicePopUp->setSelected(0); - } - } - - if (!loadMusicDeviceSetting(_gmDevicePopUp, "gm_device")) { - if (_domain.equals(Common::ConfigManager::kApplicationDomain)) { - if (!loadMusicDeviceSetting(_gmDevicePopUp, Common::String(), MT_GM)) - _gmDevicePopUp->setSelected(0); - } else { - _gmDevicePopUp->setSelected(0); - } - } - if (_oplPopUp) { OPL::Config::DriverId id = MAX(OPL::Config::parse(ConfMan.get("opl_driver", _domain)), 0); _oplPopUp->setSelectedTag(id); @@ -230,16 +213,18 @@ void OptionsDialog::open() { } if (_multiMidiCheckbox) { + if (!loadMusicDeviceSetting(_gmDevicePopUp, "gm_device")) { + if (_domain.equals(Common::ConfigManager::kApplicationDomain)) { + if (!loadMusicDeviceSetting(_gmDevicePopUp, Common::String(), MT_GM)) + _gmDevicePopUp->setSelected(0); + } else { + _gmDevicePopUp->setSelected(0); + } + } // Multi midi setting _multiMidiCheckbox->setState(ConfMan.getBool("multi_midi", _domain)); - // Native mt32 setting - _mt32Checkbox->setState(ConfMan.getBool("native_mt32", _domain)); - - // GS extensions setting - _enableGSCheckbox->setState(ConfMan.getBool("enable_gs", _domain)); - Common::String soundFont(ConfMan.get("soundfont", _domain)); if (soundFont.empty() || !ConfMan.hasKey("soundfont", _domain)) { _soundFont->setLabel(_("None")); @@ -257,6 +242,24 @@ void OptionsDialog::open() { _midiGainLabel->setLabel(buf); } + // MT-32 options + if (_mt32DevicePopUp) { + if (!loadMusicDeviceSetting(_mt32DevicePopUp, "mt32_device")) { + if (_domain.equals(Common::ConfigManager::kApplicationDomain)) { + if (!loadMusicDeviceSetting(_mt32DevicePopUp, Common::String(), MT_MT32)) + _mt32DevicePopUp->setSelected(0); + } else { + _mt32DevicePopUp->setSelected(0); + } + } + + // Native mt32 setting + _mt32Checkbox->setState(ConfMan.getBool("native_mt32", _domain)); + + // GS extensions setting + _enableGSCheckbox->setState(ConfMan.getBool("enable_gs", _domain)); + } + // Volume options if (_musicVolumeSlider) { int vol; @@ -353,12 +356,8 @@ void OptionsDialog::close() { if (_midiPopUp) { if (_enableAudioSettings) { saveMusicDeviceSetting(_midiPopUp, "music_driver"); - saveMusicDeviceSetting(_mt32DevicePopUp, "mt32_device"); - saveMusicDeviceSetting(_gmDevicePopUp, "gm_device"); } else { ConfMan.removeKey("music_driver", _domain); - ConfMan.removeKey("mt32_device", _domain); - ConfMan.removeKey("gm_device", _domain); } } @@ -391,9 +390,9 @@ void OptionsDialog::close() { // MIDI options if (_multiMidiCheckbox) { if (_enableMIDISettings) { + saveMusicDeviceSetting(_gmDevicePopUp, "gm_device"); + ConfMan.setBool("multi_midi", _multiMidiCheckbox->getState(), _domain); - ConfMan.setBool("native_mt32", _mt32Checkbox->getState(), _domain); - ConfMan.setBool("enable_gs", _enableGSCheckbox->getState(), _domain); ConfMan.setInt("midi_gain", _midiGainSlider->getValue(), _domain); Common::String soundFont(_soundFont->getLabel()); @@ -402,14 +401,24 @@ void OptionsDialog::close() { else ConfMan.removeKey("soundfont", _domain); } else { + ConfMan.removeKey("gm_device", _domain); ConfMan.removeKey("multi_midi", _domain); - ConfMan.removeKey("native_mt32", _domain); - ConfMan.removeKey("enable_gs", _domain); ConfMan.removeKey("midi_gain", _domain); ConfMan.removeKey("soundfont", _domain); } } + // MT-32 options + if (_enableMT32Settings) { + saveMusicDeviceSetting(_mt32DevicePopUp, "mt32_device"); + ConfMan.setBool("native_mt32", _mt32Checkbox->getState(), _domain); + ConfMan.setBool("enable_gs", _enableGSCheckbox->getState(), _domain); + } else { + ConfMan.removeKey("mt32_device", _domain); + ConfMan.removeKey("native_mt32", _domain); + ConfMan.removeKey("enable_gs", _domain); + } + // Subtitle options if (_subToggleGroup) { if (_enableSubtitleSettings) { @@ -513,10 +522,6 @@ void OptionsDialog::setAudioSettingsState(bool enabled) { _enableAudioSettings = enabled; _midiPopUpDesc->setEnabled(enabled); _midiPopUp->setEnabled(enabled); - _mt32DevicePopUpDesc->setEnabled(_domain.equals(Common::ConfigManager::kApplicationDomain) ? enabled : false); - _mt32DevicePopUp->setEnabled(_domain.equals(Common::ConfigManager::kApplicationDomain) ? enabled : false); - _gmDevicePopUpDesc->setEnabled(_domain.equals(Common::ConfigManager::kApplicationDomain) ? enabled : false); - _gmDevicePopUp->setEnabled(_domain.equals(Common::ConfigManager::kApplicationDomain) ? enabled : false); uint32 allFlags = MidiDriver::musicType2GUIO((uint32)-1); @@ -537,6 +542,9 @@ void OptionsDialog::setMIDISettingsState(bool enabled) { if (_guioptions & Common::GUIO_NOMIDI) enabled = false; + _gmDevicePopUpDesc->setEnabled(_domain.equals(Common::ConfigManager::kApplicationDomain) ? enabled : false); + _gmDevicePopUp->setEnabled(_domain.equals(Common::ConfigManager::kApplicationDomain) ? enabled : false); + _enableMIDISettings = enabled; _soundFontButton->setEnabled(enabled); @@ -548,13 +556,21 @@ void OptionsDialog::setMIDISettingsState(bool enabled) { _soundFontClearButton->setEnabled(false); _multiMidiCheckbox->setEnabled(enabled); - _mt32Checkbox->setEnabled(enabled); - _enableGSCheckbox->setEnabled(enabled); _midiGainDesc->setEnabled(enabled); _midiGainSlider->setEnabled(enabled); _midiGainLabel->setEnabled(enabled); } +void OptionsDialog::setMT32SettingsState(bool enabled) { + _enableMT32Settings = enabled; + + _mt32DevicePopUpDesc->setEnabled(_domain.equals(Common::ConfigManager::kApplicationDomain) ? enabled : false); + _mt32DevicePopUp->setEnabled(_domain.equals(Common::ConfigManager::kApplicationDomain) ? enabled : false); + + _mt32Checkbox->setEnabled(enabled); + _enableGSCheckbox->setEnabled(enabled); +} + void OptionsDialog::setVolumeSettingsState(bool enabled) { bool ena; @@ -645,11 +661,6 @@ void OptionsDialog::addAudioControls(GuiObject *boss, const Common::String &pref _midiPopUpDesc = new StaticTextWidget(boss, prefix + "auMidiPopupDesc", _domain == Common::ConfigManager::kApplicationDomain ? _("Preferred Device:") : _("Music Device:"), _domain == Common::ConfigManager::kApplicationDomain ? _("Specifies preferred sound device or sound card emulator") : _("Specifies output sound device or sound card emulator")); _midiPopUp = new PopUpWidget(boss, prefix + "auMidiPopup", _("Specifies output sound device or sound card emulator")); - _mt32DevicePopUpDesc = new StaticTextWidget(boss, prefix + "auPrefMt32PopupDesc", _("MT-32 Device:"), _("Specifies default sound device for Roland MT-32/LAPC1/CM32l/CM64 output")); - _mt32DevicePopUp = new PopUpWidget(boss, prefix + "auPrefMt32Popup"); - _gmDevicePopUpDesc = new StaticTextWidget(boss, prefix + "auPrefGmPopupDesc", _("GM Device:"), _("Specifies default sound device for General MIDI output")); - _gmDevicePopUp = new PopUpWidget(boss, prefix + "auPrefGmPopup"); - // Populate it uint32 allFlags = MidiDriver::musicType2GUIO((uint32)-1); @@ -668,22 +679,9 @@ void OptionsDialog::addAudioControls(GuiObject *boss, const Common::String &pref || (deviceGuiOption == Common::GUIO_MIDIGM && (_guioptions & Common::GUIO_MIDIMT32)) || d->getMusicDriverId() == "auto" || d->getMusicDriverId() == "null") // always add default and null device _midiPopUp->appendEntry(d->getCompleteName(), d->getHandle()); - - if (d->getMusicType() >= MT_GM || d->getMusicDriverId() == "auto") { - _mt32DevicePopUp->appendEntry(d->getCompleteName(), d->getHandle()); - if (d->getMusicType() != MT_MT32) - _gmDevicePopUp->appendEntry(d->getCompleteName(), d->getHandle()); - } } } - if (!_domain.equals(Common::ConfigManager::kApplicationDomain)) { - _mt32DevicePopUpDesc->setEnabled(false); - _mt32DevicePopUp->setEnabled(false); - _gmDevicePopUpDesc->setEnabled(false); - _gmDevicePopUp->setEnabled(false); - } - // The OPL emulator popup & a label _oplPopUpDesc = new StaticTextWidget(boss, prefix + "auOPLPopupDesc", _("AdLib emulator:"), _("AdLib is used for music in many games")); _oplPopUp = new PopUpWidget(boss, prefix + "auOPLPopup", _("AdLib is used for music in many games")); @@ -707,6 +705,26 @@ void OptionsDialog::addAudioControls(GuiObject *boss, const Common::String &pref } void OptionsDialog::addMIDIControls(GuiObject *boss, const Common::String &prefix) { + _gmDevicePopUpDesc = new StaticTextWidget(boss, prefix + "auPrefGmPopupDesc", _("GM Device:"), _("Specifies default sound device for General MIDI output")); + _gmDevicePopUp = new PopUpWidget(boss, prefix + "auPrefGmPopup"); + + // Populate + const MusicPlugin::List p = MusicMan.getPlugins(); + for (MusicPlugin::List::const_iterator m = p.begin(); m != p.end(); ++m) { + MusicDevices i = (**m)->getDevices(); + for (MusicDevices::iterator d = i.begin(); d != i.end(); ++d) { + if (d->getMusicType() >= MT_GM || d->getMusicDriverId() == "auto") { + if (d->getMusicType() != MT_MT32) + _gmDevicePopUp->appendEntry(d->getCompleteName(), d->getHandle()); + } + } + } + + if (!_domain.equals(Common::ConfigManager::kApplicationDomain)) { + _gmDevicePopUpDesc->setEnabled(false); + _gmDevicePopUp->setEnabled(false); + } + // SoundFont _soundFontButton = new ButtonWidget(boss, prefix + "mcFontButton", _("SoundFont:"), _("SoundFont is supported by some audio cards, Fluidsynth and Timidity"), kChooseSoundFontCmd); _soundFont = new StaticTextWidget(boss, prefix + "mcFontPath", _("None"), _("SoundFont is supported by some audio cards, Fluidsynth and Timidity")); @@ -715,12 +733,6 @@ void OptionsDialog::addMIDIControls(GuiObject *boss, const Common::String &prefi // Multi midi setting _multiMidiCheckbox = new CheckboxWidget(boss, prefix + "mcMixedCheckbox", _("Mixed AdLib/MIDI mode"), _("Use both MIDI and AdLib sound generation")); - // Native mt32 setting - _mt32Checkbox = new CheckboxWidget(boss, prefix + "mcMt32Checkbox", _("True Roland MT-32 (disable GM emulation)"), _("Check if you want to use your real hardware Roland-compatible sound device connected to your computer")); - - // GS Extensions setting - _enableGSCheckbox = new CheckboxWidget(boss, prefix + "mcGSCheckbox", _("Enable Roland GS Mode"), _("Turns off General MIDI mapping for games with Roland MT-32 soundtrack")); - // MIDI gain setting (FluidSynth uses this) _midiGainDesc = new StaticTextWidget(boss, prefix + "mcMidiGainText", _("MIDI gain:")); _midiGainSlider = new SliderWidget(boss, prefix + "mcMidiGainSlider", 0, kMidiGainChanged); @@ -731,6 +743,34 @@ void OptionsDialog::addMIDIControls(GuiObject *boss, const Common::String &prefi _enableMIDISettings = true; } +void OptionsDialog::addMT32Controls(GuiObject *boss, const Common::String &prefix) { + _mt32DevicePopUpDesc = new StaticTextWidget(boss, prefix + "auPrefMt32PopupDesc", _("MT-32 Device:"), _("Specifies default sound device for Roland MT-32/LAPC1/CM32l/CM64 output")); + _mt32DevicePopUp = new PopUpWidget(boss, prefix + "auPrefMt32Popup"); + + // Native mt32 setting + _mt32Checkbox = new CheckboxWidget(boss, prefix + "mcMt32Checkbox", _("True Roland MT-32 (disable GM emulation)"), _("Check if you want to use your real hardware Roland-compatible sound device connected to your computer")); + + // GS Extensions setting + _enableGSCheckbox = new CheckboxWidget(boss, prefix + "mcGSCheckbox", _("Enable Roland GS Mode"), _("Turns off General MIDI mapping for games with Roland MT-32 soundtrack")); + + const MusicPlugin::List p = MusicMan.getPlugins(); + for (MusicPlugin::List::const_iterator m = p.begin(); m != p.end(); ++m) { + MusicDevices i = (**m)->getDevices(); + for (MusicDevices::iterator d = i.begin(); d != i.end(); ++d) { + if (d->getMusicType() >= MT_GM || d->getMusicDriverId() == "auto") { + _mt32DevicePopUp->appendEntry(d->getCompleteName(), d->getHandle()); + } + } + } + + if (!_domain.equals(Common::ConfigManager::kApplicationDomain)) { + _mt32DevicePopUpDesc->setEnabled(false); + _mt32DevicePopUp->setEnabled(false); + } + + _enableMIDISettings = true; +} + // The function has an extra slider range parameter, since both the launcher and SCUMM engine // make use of the widgets. The launcher range is 0-255. SCUMM's 0-9 void OptionsDialog::addSubtitleControls(GuiObject *boss, const Common::String &prefix, int maxSliderVal) { @@ -892,7 +932,13 @@ GlobalOptionsDialog::GlobalOptionsDialog() addMIDIControls(tab, "GlobalOptions_MIDI."); // - // 4) The miscellaneous tab + // 4) The MT-32 tab + // + tab->addTab(_("MT-32")); + addMT32Controls(tab, "GlobalOptions_MT32."); + + // + // 5) The Paths tab // tab->addTab(_("Paths")); @@ -916,6 +962,9 @@ GlobalOptionsDialog::GlobalOptionsDialog() #endif #endif + // + // 6) The miscellaneous tab + // tab->addTab(_("Misc")); new ButtonWidget(tab, "GlobalOptions_Misc.ThemeButton", _("Theme:"), 0, kChooseThemeCmd); diff --git a/gui/options.h b/gui/options.h index 235cb24462..c05f263d00 100644 --- a/gui/options.h +++ b/gui/options.h @@ -68,6 +68,7 @@ protected: void addGraphicControls(GuiObject *boss, const Common::String &prefix); void addAudioControls(GuiObject *boss, const Common::String &prefix); void addMIDIControls(GuiObject *boss, const Common::String &prefix); + void addMT32Controls(GuiObject *boss, const Common::String &prefix); void addVolumeControls(GuiObject *boss, const Common::String &prefix); // The default value is the launcher's non-scaled talkspeed value. When SCUMM uses the widget, // it uses its own scale @@ -76,6 +77,7 @@ protected: void setGraphicSettingsState(bool enabled); void setAudioSettingsState(bool enabled); void setMIDISettingsState(bool enabled); + void setMT32SettingsState(bool enabled); void setVolumeSettingsState(bool enabled); void setSubtitleSettingsState(bool enabled); @@ -120,12 +122,17 @@ private: // bool _enableMIDISettings; CheckboxWidget *_multiMidiCheckbox; - CheckboxWidget *_mt32Checkbox; - CheckboxWidget *_enableGSCheckbox; StaticTextWidget *_midiGainDesc; SliderWidget *_midiGainSlider; StaticTextWidget *_midiGainLabel; + // + // MT-32 controls + // + bool _enableMT32Settings; + CheckboxWidget *_mt32Checkbox; + CheckboxWidget *_enableGSCheckbox; + // // Subtitle controls // diff --git a/gui/themes/scummclassic.zip b/gui/themes/scummclassic.zip index b6b4ffe2e7..8722ece7a6 100644 Binary files a/gui/themes/scummclassic.zip and b/gui/themes/scummclassic.zip differ diff --git a/gui/themes/scummclassic/classic_layout.stx b/gui/themes/scummclassic/classic_layout.stx index 0a38ea4b40..74b8bf4b2c 100644 --- a/gui/themes/scummclassic/classic_layout.stx +++ b/gui/themes/scummclassic/classic_layout.stx @@ -231,22 +231,6 @@ type = 'PopUp' /> - - - - - - - - + + + + - - + + + + + + + + + + + @@ -518,6 +523,15 @@ + + + + + + + @@ -229,22 +229,6 @@ type = 'PopUp' /> - - - - - - - - + + + + + + + + + + + + + + + @@ -521,6 +532,15 @@ + + + + + + + - - - - - - - - + + + + - - + + + + + + + + + + + @@ -533,6 +538,15 @@ + + + + + + + @@ -227,22 +227,6 @@ type = 'PopUp' /> - - - - - - - - + + + + - - + + + + + + + + + + + @@ -519,6 +524,15 @@ + + + + + + + " " " " " " " " " @@ -190,22 +190,6 @@ "/> " " " " " -" " -" " -" " -" " -" " -" " -" " -" " " " @@ -293,6 +277,14 @@ " " " " " " +" " +" " +" " +" " " " " " " " " " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " " " " " " " @@ -471,6 +481,14 @@ " " " " " " +" " +" " +" " +" " +" " +" " " " " " " " " " " " -" " -" " -" " -" " -" " -" " -" " -" " " " @@ -1516,6 +1518,14 @@ " " " " " " +" " +" " +" " +" " " " @@ -1530,12 +1540,6 @@ " " -" " -" " " " " " " " " " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " " " " " " " @@ -1687,6 +1709,14 @@ " " " " " " +" " +" " +" " +" " +" " +" " " " " " " r.right || r.left + (i + 1) * tabWidth > r.right) + continue; + Common::Rect tabRect(r.left + i * tabWidth, r.top, r.left + (i + 1) * tabWidth, r.top + tabHeight); queueDD(kDDTabInactive, tabRect); queueDDText(getTextData(kDDTabInactive), getTextColor(kDDTabInactive), tabRect, tabs[i], false, false, _widgets[kDDTabInactive]->_textAlignH, _widgets[kDDTabInactive]->_textAlignV); } - if (active >= 0) { + if (active >= 0 && + (r.left + active * tabWidth < r.right) && (r.left + (active + 1) * tabWidth < r.right)) { Common::Rect tabRect(r.left + active * tabWidth, r.top, r.left + (active + 1) * tabWidth, r.top + tabHeight); const uint16 tabLeft = active * tabWidth; const uint16 tabRight = MAX(r.right - tabRect.right, 0); -- cgit v1.2.3 From dec30186eb4892598a5d522633060cc20208dff1 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sun, 25 Jul 2010 16:38:25 +0000 Subject: GUI: Fix MIDI gain position in MIDI tab for lowres classic theme. svn-id: r51277 --- gui/themes/default.inc | 1830 ++++++++++----------- gui/themes/scummclassic.zip | Bin 58134 -> 58008 bytes gui/themes/scummclassic/classic_layout_lowres.stx | 6 - gui/themes/scummmodern.zip | Bin 165317 -> 165317 bytes 4 files changed, 912 insertions(+), 924 deletions(-) (limited to 'gui') diff --git a/gui/themes/default.inc b/gui/themes/default.inc index 2ca6b87c1c..f03b3fc61e 100644 --- a/gui/themes/default.inc +++ b/gui/themes/default.inc @@ -300,12 +300,6 @@ " " -" " -" " " " " " " " " " -" " -" " -" " -" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " +" " +" " +" " -" " +" " -" " -" " -" " +" " +" " +" " +" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " +" " +" " +" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " +" " +" " +" " +" " +" " -" " -" " -" " -" " -" " -" " +" " +" " -" " -" " -" " +" " -" " -" " -" " -" " +" " +" " +" " +" " +" " +" " +" " +" " -" " -" " -" " -" " +" " +" " +" " +" " +" " +" " -" " -" " -" " -" " +" " +" " -" " -" " -" " -" " -" " -" " +" " -" " -" " -" " -" " -" " -" " +" " +" " +" " +" " +" " -" " -" " -" " -" " -" " -" " +" " +" " -" " -" " -" " -" " +" " +" " -" " -" " -" " -" " +" " +" " -" " -" " -" " -" " -" " -" " +" " +" " -" " -" " -" " -" " -" " -" " -" " +" " +" " +" " +" " +" " +" " +" " -" " -" " -" " -" " -" " -" " -" " -" " -" " +" " +" " -" " -" " -" " -" " -" " +" " +" " -" " -" " -" " -" " -" " -" " -" " +" " +" " +" " -" " +" " +" " +" " +" " +" " +" " -" " -" " -" " -" " -" " +" " +" " -" " -" " -" " -" " -" " -" " -" " +" " -" " +" " -" " -" " -" " -" " -" " +" " +" " +" " +" " +" " +" " -" " -" " -" " -" " +" " -" " -" " -" " -" " -" " -" " +" " +" " +" " +" " +" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " +" " +" " -" " -" " +" " +" " -" " -" " +" " +" " -" " -" " +" " +" " +" " +" " +" " +" " -" " -" " +" " +" " -" " -" " +" " +" " -" " -" " +" " +" " -" " -" " +" " -" " -" " -" " -" " +" " +" " +" " +" " -" " -" " +" " -" " +" " +" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " +" " +" " " " " " " " -" " -" " +" " +" " " " -" " +" " " " " " " " " " -" " +" " " " -" " -" " -" " +" " " " -" " -" " -" " +" " +" " +" " +" " " " -" " +" " +" " +" " -" " +" " +" " +" " +" " +" " +" " " " " " -" " +" " " " +" " +" " +" " +" " +" " +" " " " -" " -" " " " " " -" " -" " " " " " -" " -" " " " -" " -" " +" " -" " -" " +" " +" " +" " +" " +" " +" " -" " " " -" " -" " +" " -" " -" " +" " +" " +" " " " " " " " -" " -" " -" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " " " +" " +" " " " @@ -1485,7 +1405,7 @@ "type='SmallLabel' " "/> " " " -" " +" " " " @@ -1496,7 +1416,7 @@ "type='SmallLabel' " "/> " " " -" " +" " " " @@ -1508,516 +1428,590 @@ "/> " " " " " -" " +" " " " " " " " -" " -" " -" " -" " -" " +" " +" " -" " -" " -" " -" " -" " -" " " " -" " -" " -" " +" " -" " -" " " " -" " -" " -" " -" " -" " -" " -" " +" " +" " -" " -" " +" " -" " " " +" " " " -" " -" " -" " -" " -" " +" " +" " -" " -" " -" " -" " +" " +" " " " -" " -" " +" " +" " -" " -" " -" " -" " +" " -" " " " " " " " -" " -" " -" " -" " -" " +" " +" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " +" " -" " -" " -" " +" " " " +" " " " -" " -" " -" " +" " +" " -" " -" " -" " -" " -" " -" " -" " +" " " " -" " -" " -" " -" " -" " -" " -" " -" " " " -" " " " " " " " -" " -" " -" " +" " +" " +" " -" " -" " -" " -" " -" " -" " -" " " " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " " " " " -" " -" " -" " +" " +" " +" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " +" " +" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " +" " +" " +" " -" " -" " -" " -" " -" " -" " -" " -" " +" " +" " -" " +" " +" " -" " +" " +" " -" " -" " -" " +" " +" " -" " +" " +" " -" " +" " +" " -" " -" " -" " +" " +" " -" " +" " +" " -" " +" " +" " -" " -" " -" " -" " -" " -" " -" " -" " -" " +" " +" " -" " -" " +" " +" " -" " -" " -" " -" " +" " +" " -" " -" " +" " +" " +" " +" " -" " -" " -" " -" " +" " +" " -" " -" " +" " +" " -" " +" " +" " -" " -" " -" " -" " -" " -" " +" " +" " -" " -" " -" " +" " +" " -" " -" " -" " -" " -" " -" " -" " +" " +" " -" " -" " -" " -" " -" " -" " -" " -" " -" " +" " +" " -" " -" " -" " -" " -" " -" " -" " -" " -" " +" " +" " -" " +" " +" " -" " +" " +" " -" " -" " +" " +" " -" " +" " +" " -" " -" " -" " -" " -" " -" " -" " -" " +" " +" " -" " -" " -" " +" " +" " -" " -" " -" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " diff --git a/gui/themes/scummclassic.zip b/gui/themes/scummclassic.zip index 8722ece7a6..6b079f7afc 100644 Binary files a/gui/themes/scummclassic.zip and b/gui/themes/scummclassic.zip differ diff --git a/gui/themes/scummclassic/classic_layout_lowres.stx b/gui/themes/scummclassic/classic_layout_lowres.stx index 057cc3ea0e..622c23439e 100644 --- a/gui/themes/scummclassic/classic_layout_lowres.stx +++ b/gui/themes/scummclassic/classic_layout_lowres.stx @@ -342,12 +342,6 @@ - - getState(), _domain); - ConfMan.setBool("enable_gs", _enableGSCheckbox->getState(), _domain); - } else { - ConfMan.removeKey("mt32_device", _domain); - ConfMan.removeKey("native_mt32", _domain); - ConfMan.removeKey("enable_gs", _domain); + if (_mt32DevicePopUp) { + if (_enableMT32Settings) { + saveMusicDeviceSetting(_mt32DevicePopUp, "mt32_device"); + ConfMan.setBool("native_mt32", _mt32Checkbox->getState(), _domain); + ConfMan.setBool("enable_gs", _enableGSCheckbox->getState(), _domain); + } else { + ConfMan.removeKey("mt32_device", _domain); + ConfMan.removeKey("native_mt32", _domain); + ConfMan.removeKey("enable_gs", _domain); + } } // Subtitle options -- cgit v1.2.3 From 5787c8bb88eeb6ecccf8e28d8302bbdac4a1bbaa Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Tue, 27 Jul 2010 20:17:29 +0000 Subject: GUI: Rename Font cache to match new font naming scheme svn-id: r51388 --- gui/themes/scummclassic.zip | Bin 58008 -> 58510 bytes gui/themes/scummmodern.zip | Bin 165317 -> 165851 bytes gui/themes/scummmodern/helvb12-iso-8859-1.fcc | Bin 0 -> 5615 bytes gui/themes/scummmodern/helvr12-l1.fcc | Bin 5615 -> 0 bytes 4 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 gui/themes/scummmodern/helvb12-iso-8859-1.fcc delete mode 100644 gui/themes/scummmodern/helvr12-l1.fcc (limited to 'gui') diff --git a/gui/themes/scummclassic.zip b/gui/themes/scummclassic.zip index 6b079f7afc..299bc41339 100644 Binary files a/gui/themes/scummclassic.zip and b/gui/themes/scummclassic.zip differ diff --git a/gui/themes/scummmodern.zip b/gui/themes/scummmodern.zip index 371d73c211..cd24d781bb 100644 Binary files a/gui/themes/scummmodern.zip and b/gui/themes/scummmodern.zip differ diff --git a/gui/themes/scummmodern/helvb12-iso-8859-1.fcc b/gui/themes/scummmodern/helvb12-iso-8859-1.fcc new file mode 100644 index 0000000000..651a25934a Binary files /dev/null and b/gui/themes/scummmodern/helvb12-iso-8859-1.fcc differ diff --git a/gui/themes/scummmodern/helvr12-l1.fcc b/gui/themes/scummmodern/helvr12-l1.fcc deleted file mode 100644 index 651a25934a..0000000000 Binary files a/gui/themes/scummmodern/helvr12-l1.fcc and /dev/null differ -- cgit v1.2.3