mirror of
https://github.com/minetest/minetest.git
synced 2024-11-27 10:03:45 +01:00
Remove ClientMap::m_camera_mutex
All places that lock this mutex are only called by the main thread: ClientMap::updateCamera(), ClientMap::updateDrawList(), ClientMap::renderMap(), ClientMap::renderPostFx().
This commit is contained in:
parent
4adbd69a37
commit
180893e79d
@ -157,12 +157,9 @@ void ClientMap::updateDrawList(video::IVideoDriver* driver)
|
|||||||
}
|
}
|
||||||
m_drawlist.clear();
|
m_drawlist.clear();
|
||||||
|
|
||||||
m_camera_mutex.lock();
|
|
||||||
v3f camera_position = m_camera_position;
|
v3f camera_position = m_camera_position;
|
||||||
v3f camera_direction = m_camera_direction;
|
v3f camera_direction = m_camera_direction;
|
||||||
f32 camera_fov = m_camera_fov;
|
f32 camera_fov = m_camera_fov;
|
||||||
//v3s16 camera_offset = m_camera_offset;
|
|
||||||
m_camera_mutex.unlock();
|
|
||||||
|
|
||||||
// Use a higher fov to accomodate faster camera movements.
|
// Use a higher fov to accomodate faster camera movements.
|
||||||
// Blocks are cropped better when they are drawn.
|
// Blocks are cropped better when they are drawn.
|
||||||
@ -433,11 +430,9 @@ void ClientMap::renderMap(video::IVideoDriver* driver, s32 pass)
|
|||||||
int crack = m_client->getCrackLevel();
|
int crack = m_client->getCrackLevel();
|
||||||
u32 daynight_ratio = m_client->getEnv().getDayNightRatio();
|
u32 daynight_ratio = m_client->getEnv().getDayNightRatio();
|
||||||
|
|
||||||
m_camera_mutex.lock();
|
|
||||||
v3f camera_position = m_camera_position;
|
v3f camera_position = m_camera_position;
|
||||||
v3f camera_direction = m_camera_direction;
|
v3f camera_direction = m_camera_direction;
|
||||||
f32 camera_fov = m_camera_fov;
|
f32 camera_fov = m_camera_fov;
|
||||||
m_camera_mutex.unlock();
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Get all blocks and draw all visible ones
|
Get all blocks and draw all visible ones
|
||||||
@ -799,11 +794,7 @@ void ClientMap::renderPostFx(CameraMode cam_mode)
|
|||||||
// Sadly ISceneManager has no "post effects" render pass, in that case we
|
// Sadly ISceneManager has no "post effects" render pass, in that case we
|
||||||
// could just register for that and handle it in renderMap().
|
// could just register for that and handle it in renderMap().
|
||||||
|
|
||||||
m_camera_mutex.lock();
|
MapNode n = getNodeNoEx(floatToInt(m_camera_position, BS));
|
||||||
v3f camera_position = m_camera_position;
|
|
||||||
m_camera_mutex.unlock();
|
|
||||||
|
|
||||||
MapNode n = getNodeNoEx(floatToInt(camera_position, BS));
|
|
||||||
|
|
||||||
// - If the player is in a solid node, make everything black.
|
// - If the player is in a solid node, make everything black.
|
||||||
// - If the player is in liquid, draw a semi-transparent overlay.
|
// - If the player is in liquid, draw a semi-transparent overlay.
|
||||||
|
@ -89,7 +89,6 @@ public:
|
|||||||
|
|
||||||
void updateCamera(v3f pos, v3f dir, f32 fov, v3s16 offset)
|
void updateCamera(v3f pos, v3f dir, f32 fov, v3s16 offset)
|
||||||
{
|
{
|
||||||
MutexAutoLock lock(m_camera_mutex);
|
|
||||||
m_camera_position = pos;
|
m_camera_position = pos;
|
||||||
m_camera_direction = dir;
|
m_camera_direction = dir;
|
||||||
m_camera_fov = fov;
|
m_camera_fov = fov;
|
||||||
@ -149,7 +148,6 @@ private:
|
|||||||
v3f m_camera_direction;
|
v3f m_camera_direction;
|
||||||
f32 m_camera_fov;
|
f32 m_camera_fov;
|
||||||
v3s16 m_camera_offset;
|
v3s16 m_camera_offset;
|
||||||
Mutex m_camera_mutex;
|
|
||||||
|
|
||||||
std::map<v3s16, MapBlock*> m_drawlist;
|
std::map<v3s16, MapBlock*> m_drawlist;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user