From a555e2d9b0ccee452996381a44677b8bec210036 Mon Sep 17 00:00:00 2001 From: gregorycu Date: Sat, 24 Jan 2015 13:03:57 +1100 Subject: Make the GameGlobalShaderConstantSetter use the settings callback (8% perf improvement in game loop) Amend the settings callback to support userdata --- src/settings.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/settings.h') diff --git a/src/settings.h b/src/settings.h index 89f7589df..47feb1755 100644 --- a/src/settings.h +++ b/src/settings.h @@ -32,7 +32,7 @@ class Settings; struct NoiseParams; /** function type to register a changed callback */ -typedef void (*setting_changed_callback)(const std::string); +typedef void (*setting_changed_callback)(const std::string, void *userdata); enum ValueType { VALUETYPE_STRING, @@ -204,7 +204,7 @@ public: void clear(); void updateValue(const Settings &other, const std::string &name); void update(const Settings &other); - void registerChangedCallback(std::string name, setting_changed_callback cbf); + void registerChangedCallback(std::string name, setting_changed_callback cbf, void *userdata = NULL); private: @@ -215,7 +215,7 @@ private: std::map m_settings; std::map m_defaults; - std::map > m_callbacks; + std::map > > m_callbacks; // All methods that access m_settings/m_defaults directly should lock this. mutable JMutex m_mutex; }; -- cgit v1.2.3