]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/settings.h
Fix gettext on MSVC
[dragonfireclient.git] / src / settings.h
index 47feb1755efb4443dfd3e56cf00c4c96a5977df3..1a7d9ab96aad4834d889f4bbd81a8b844e51c457 100644 (file)
@@ -32,7 +32,7 @@ class Settings;
 struct NoiseParams;
 
 /** function type to register a changed callback */
-typedef void (*setting_changed_callback)(const std::string, void *userdata);
+typedef void (*setting_changed_callback)(const std::string, void*);
 
 enum ValueType {
        VALUETYPE_STRING,
@@ -205,6 +205,7 @@ class Settings {
        void updateValue(const Settings &other, const std::string &name);
        void update(const Settings &other);
        void registerChangedCallback(std::string name, setting_changed_callback cbf, void *userdata = NULL);
+       void deregisterChangedCallback(std::string name, setting_changed_callback cbf, void *userdata = NULL);
 
 private:
 
@@ -215,9 +216,12 @@ class Settings {
 
        std::map<std::string, SettingsEntry> m_settings;
        std::map<std::string, SettingsEntry> m_defaults;
+
        std::map<std::string, std::vector<std::pair<setting_changed_callback,void*> > > m_callbacks;
-       // All methods that access m_settings/m_defaults directly should lock this.
-       mutable JMutex m_mutex;
+
+       mutable JMutex m_callbackMutex;
+       mutable JMutex m_mutex; // All methods that access m_settings/m_defaults directly should lock this.
+
 };
 
 #endif