summaryrefslogtreecommitdiff
path: root/src/util/numeric.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/numeric.cpp')
-rw-r--r--src/util/numeric.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/util/numeric.cpp b/src/util/numeric.cpp
index 3fd1c9cf9..42ebd9022 100644
--- a/src/util/numeric.cpp
+++ b/src/util/numeric.cpp
@@ -23,17 +23,17 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "log.h"
#include "../constants.h" // BS, MAP_BLOCKSIZE
#include "../noise.h" // PseudoRandom, PcgRandom
-#include "../jthread/jmutexautolock.h"
+#include "../threading/mutex_auto_lock.h"
#include <string.h>
#include <iostream>
std::map<u16, std::vector<v3s16> > FacePositionCache::m_cache;
-JMutex FacePositionCache::m_cache_mutex;
+Mutex FacePositionCache::m_cache_mutex;
// Calculate the borders of a "d-radius" cube
// TODO: Make it work without mutex and data races, probably thread-local
std::vector<v3s16> FacePositionCache::getFacePositions(u16 d)
{
- JMutexAutoLock cachelock(m_cache_mutex);
+ MutexAutoLock cachelock(m_cache_mutex);
if (m_cache.find(d) != m_cache.end())
return m_cache[d];
@@ -244,7 +244,10 @@ bool isBlockInSight(v3s16 blockpos_b, v3f camera_pos, v3f camera_dir,
f32 cosangle = dforward / blockpos_adj.getLength();
// If block is not in the field of view, skip it
- if(cosangle < cos(camera_fov / 2))
+ // HOTFIX: use sligthly increased angle (+10%) to fix too agressive
+ // culling. Somebody have to find out whats wrong with the math here.
+ // Previous value: camera_fov / 2
+ if(cosangle < cos(camera_fov * 0.55))
return false;
return true;