diff options
author | Max Horn | 2004-03-28 20:31:18 +0000 |
---|---|---|
committer | Max Horn | 2004-03-28 20:31:18 +0000 |
commit | 39765b0d19fd8409cf4e0e96c9edc2ad5b25f247 (patch) | |
tree | 3f1aef98ad8882a2d1147cc4c7a4a838b60f22ac /common | |
parent | 09e3fec623c1ecea73a23d12891790569d1baa40 (diff) | |
download | scummvm-rg350-39765b0d19fd8409cf4e0e96c9edc2ad5b25f247.tar.gz scummvm-rg350-39765b0d19fd8409cf4e0e96c9edc2ad5b25f247.tar.bz2 scummvm-rg350-39765b0d19fd8409cf4e0e96c9edc2ad5b25f247.zip |
Remove explicit OSystem parameter from StackLock constructor; added OSystem::displayMessageOnOSD (not yet used; default implementation provided)
svn-id: r13413
Diffstat (limited to 'common')
-rw-r--r-- | common/system.cpp | 21 | ||||
-rw-r--r-- | common/system.h | 24 |
2 files changed, 31 insertions, 14 deletions
diff --git a/common/system.cpp b/common/system.cpp index ce9ba67c3c..b9cfb8de8f 100644 --- a/common/system.cpp +++ b/common/system.cpp @@ -26,6 +26,8 @@ #include "base/gameDetector.h" +#include "gui/message.h" + #include "common/config-manager.h" #include "common/system.h" @@ -84,15 +86,20 @@ bool OSystem::setGraphicsMode(const char *name) { return false; } +void OSystem::displayMessageOnOSD(const char *msg) { + // Display the message for 1.5 seconds + GUI::TimedMessageDialog dialog(msg, 1500); + dialog.runModal(); +} + + #pragma mark - namespace Common { -StackLock::StackLock(OSystem::MutexRef mutex, OSystem *syst, const char *mutexName) - : _mutex(mutex), _syst(syst), _mutexName(mutexName) { - if (syst == 0) - _syst = g_system; +StackLock::StackLock(OSystem::MutexRef mutex, const char *mutexName) + : _mutex(mutex), _mutexName(mutexName) { lock(); } @@ -101,19 +108,17 @@ StackLock::~StackLock() { } void StackLock::lock() { - assert(_syst); if (_mutexName != NULL) debug(6, "Locking mutex %s", _mutexName); - _syst->lockMutex(_mutex); + g_system->lockMutex(_mutex); } void StackLock::unlock() { - assert(_syst); if (_mutexName != NULL) debug(6, "Unlocking mutex %s", _mutexName); - _syst->unlockMutex(_mutex); + g_system->unlockMutex(_mutex); } } // End of namespace Common diff --git a/common/system.h b/common/system.h index 8f9b5a7464..2039085fdb 100644 --- a/common/system.h +++ b/common/system.h @@ -602,12 +602,25 @@ public: virtual void quit() = 0; /** - * Set a window caption or any other comparable status display to the - * given value. - * @param caption the window caption to use from now on + * Set a window caption or any other comparable status display to the + * given value. + * @param caption the window caption to use from now on */ virtual void setWindowCaption(const char *caption) {} - + + /** + * Display a message in an 'on screen display'. That is, display it in a + * fashion where it is visible on or near the screen (e.g. in a transparent + * rectangle over the regular screen content; or in a message box beneath + * it; etc.). + * + * @note There is a default implementation which uses a TimedMessageDialog + * to display the message. Hence implementing this is optional. + * + * @param msg the message to display on screen + */ + virtual void displayMessageOnOSD(const char *msg); + /** Savefile management. */ virtual SaveFileManager *get_savefile_manager() { return new SaveFileManager(); @@ -626,13 +639,12 @@ namespace Common { */ class StackLock { OSystem::MutexRef _mutex; - OSystem *_syst; const char *_mutexName; void lock(); void unlock(); public: - StackLock(OSystem::MutexRef mutex, OSystem *syst = 0, const char *mutexName = NULL); + StackLock(OSystem::MutexRef mutex, const char *mutexName = NULL); ~StackLock(); }; |