aboutsummaryrefslogtreecommitdiff
path: root/common/system.h
diff options
context:
space:
mode:
authorThierry Crozat2018-07-07 00:58:52 +0100
committerThierry Crozat2018-10-14 21:25:02 +0100
commitc39dcc57a0dd77e5764592c67881de879a435d42 (patch)
treeb66492aa4952d5fba8b2cd117bb7e90ae7e8844c /common/system.h
parent53cd6616c958e4a50644254688aea222177f2ae2 (diff)
downloadscummvm-rg350-c39dcc57a0dd77e5764592c67881de879a435d42.tar.gz
scummvm-rg350-c39dcc57a0dd77e5764592c67881de879a435d42.tar.bz2
scummvm-rg350-c39dcc57a0dd77e5764592c67881de879a435d42.zip
OSYSTEM: Add backendInitialized() function
Some feature, such as mutexes, are only available once the backend has been initialized. This new function can be used to avoid using those feature too early or too late.
Diffstat (limited to 'common/system.h')
-rw-r--r--common/system.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/common/system.h b/common/system.h
index 7caf73a8a2..405d6a90a8 100644
--- a/common/system.h
+++ b/common/system.h
@@ -190,11 +190,23 @@ protected:
*/
FilesystemFactory *_fsFactory;
+private:
+ /**
+ * Indicate if initBackend() has been called.
+ */
+ bool _backendInitialized;
+
//@}
public:
/**
+ *
+ * Destoy this OSystem instance.
+ */
+ void destroy();
+
+ /**
* The following method is called once, from main.cpp, after all
* config data (including command line params etc.) are fully loaded.
*
@@ -205,6 +217,13 @@ public:
virtual void initBackend();
/**
+ * Return false if initBackend() has not yet been called and true otherwise.
+ * Some functionalities such as mutexes cannot be used until the backend
+ * is initialized.
+ */
+ bool backendInitialized() const { return _backendInitialized; }
+
+ /**
* Allows the backend to perform engine specific init.
* Called just before the engine is run.
*/