diff options
author | est31 <MTest31@outlook.com> | 2015-10-27 21:03:59 +0100 |
---|---|---|
committer | est31 <MTest31@outlook.com> | 2015-10-27 23:19:17 +0100 |
commit | ca8e56c15a26bc5f3d1dffe5fd39e1ca4b82d6f8 (patch) | |
tree | cc5d8627278d725f630e9df99b14a6b5964b4543 /src/environment.h | |
parent | c406438b95e3df181961add56a2511b96bd9d690 (diff) | |
download | minetest-ca8e56c15a26bc5f3d1dffe5fd39e1ca4b82d6f8.tar.gz minetest-ca8e56c15a26bc5f3d1dffe5fd39e1ca4b82d6f8.tar.bz2 minetest-ca8e56c15a26bc5f3d1dffe5fd39e1ca4b82d6f8.zip |
Environment: Time of day fixes and add serverside getter
-> Put access to time variables under the time lock.
-> Merge both time locks, there is no point to have two locks.
-> Fix the lock being released too early in Environment::setTimeOfDay
-> Add serverside getter so that you don't have to get
the environment if you only have the server
Diffstat (limited to 'src/environment.h')
-rw-r--r-- | src/environment.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/environment.h b/src/environment.h index 42faf5f6d..1984cf40d 100644 --- a/src/environment.h +++ b/src/environment.h @@ -104,6 +104,11 @@ public: protected: // peer_ids in here should be unique, except that there may be many 0s std::vector<Player*> m_players; + + + /* + * Below: values under m_time_lock + */ // Time of day in milli-hours (0-23999); determines day and night u32 m_time_of_day; // Time of day in 0...1 @@ -114,6 +119,9 @@ protected: // Overriding the day-night ratio is useful for custom sky visuals bool m_enable_day_night_ratio_override; u32 m_day_night_ratio_override; + /* + * Above: values under m_time_lock + */ /* TODO: Add a callback function so these can be updated when a setting * changes. At this point in time it doesn't matter (e.g. /set @@ -127,7 +135,6 @@ protected: bool m_cache_enable_shaders; private: - Mutex m_timeofday_lock; Mutex m_time_lock; }; |